#include #include #include #include #include using namespace std; int main() { int n; cin >> n; bool x,y; x=y=1; int prevx,prevy; for(int i=1;i<=n;++i){ int a,b; cin >> a >> b; if(i==1){ prevx=a; prevy=b; } else { if(a!=prevx) x=0; if(b!=prevy) y=0; } } if(x | y) cout << "YES" << endl; else cout << "NO" << endl; /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }