#include #include #include #include #include #include #include int main(){ int n; scanf("%d",&n); int h,v; int x; int y; scanf("%d %d",&x,&y); h=x; v=y; int htrue=1,vtrue=1; for(int a0 = 0; a0 < n; a0++){ scanf("%d %d",&x,&y); if(x!=h) htrue=0; if(y!=v) vtrue=0; } if(htrue || vtrue) printf("YES"); else printf("NO"); return 0; }