/*Header file starts here*/ //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*Header File ends here*/ /*Macro starts here*/ #define f(i,j,n) for(int i=j; in; i--) #define c(x, n) x n; cin>>n #define ft int t; scanf("%d", &t); for(int c=1; c<=t; c++) #define w(n) while(n--) #define visited 1 #define unvisited -1 #define debug printf("\n< ostream &operator << (ostream &os, const vector &v) { os<<"{"; typename vector :: const_iterator it; for(it= v.begin(); it!=v.end(); it++) { if(it!=v.begin()) os<<","; os<<*it; } return os<<"}"; } template ostream &operator << (ostream & os, const set&v) { os<<"["; typename set :: const_iterator it; for(it=v.begin(); it!=v.end(); it++) { if(it!=v.begin()) os<<","; os<<*it; } return os<<"]"; } template ostream &operator << (ostream & os, const map&v) { os<<"["; typename map::const_iterator it; for(it=v.begin(); it!=v.end(); it++) { if(it != v.begin()) os<<","; os<< it ->first<<"="<second; } return os<<"]"; } int main(){ //fin(prob); //fout(prob); c(int, n); c(int, x);c(int, y); bool ans=true; f(i,1,n){ c(int , t1);c(int, t2); if(x!=t1 && y!= t2) ans=false; } if(ans) cout<<"YES"<