#include #define lli long long int #define pb push_back #define mod 1000000007 using namespace std; int main() { int n,i,j,x,y,a,b; cin>>n; cin>>a>>b; bool ok1=true,ok2=true; for(i=1;i>x>>y; if(x!=a)ok1=false; if(y!=b)ok2=false; } if(ok1 || ok2)cout<<"YES"; else cout<<"NO"; return 0; }