#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int n; cin >> n; int firstx; int firsty; cin >> firstx >> firsty; bool flagx = true; bool flagy = true; for(int a0 = 1; a0 < n; a0++){ int x; int y; cin >> x >> y; if (x != firstx) { flagx = false; } if (y != firsty) { flagy = false; } } cout << (flagx || flagy? "YES": "NO") << endl; return 0; }