#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; bool fx = true; bool fy = true; int cx = -1000; int cy = -1000; for(int a0 = 0; a0 < n; a0++){ int x; int y; cin >> x >> y; if(cx == -1000){ cx = x; cy = y; } if(cx != x){ fx = false; } if(cy != y){ fy = false; } } if(fx || fy){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }