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