#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 xarray[n]; int yarray[n]; for(int a0 = 0; a0 < n; a0++){ int x; int y; cin >> x >> y; xarray[a0] = x; yarray[a0] = y; } // Go through all x's bool samex = true; for(int i = 0; i < n - 1; i++) { if(xarray[i] != xarray[i+1]) {samex = false;} } if(samex == true) { cout << "YES"; return 0; } // Go through all y's bool samey = true; for(int i = 0; i < n - 1; i++) { if(yarray[i] != yarray[i+1]) {samey = false;} } if(samey == true) { cout << "YES"; return 0; } cout << "NO"; return 0; }