#include #include #include #include #include using namespace std; int main() { int n; cin>>n; bool h=true,v=true; n--; int x,y,a,b; cin>>x>>y; while(n--){ cin>>a>>b; if(a!=x) h = false; if(b!=y) v = false; } if(h|v) cout<<"YES"; else cout<<"NO"; /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }