#include using namespace std; int main(){ int n; cin >> n; bool hor = true; bool ver = true; bool allSame = true; int x; //1st x coordinate int y; //1st y coordinate cin >> x >> y; for(int a0 = 1; a0 < n; a0++){ int nextX; //x coordinate int nextY; //y coordinate cin >> nextX >> nextY; if(x != nextX) hor = false; if(y != nextY) ver = false; if(x != nextX || y != nextY) { allSame = false; } } if((hor || ver) && !allSame) cout << "YES" << endl; else cout << "NO" << endl; return 0; }