#include using namespace std; int main() { int n,freq_x=-1,freq_y=-1,x_x,y_y; cin>>n; while(n--){ int x,y; cin>>x>>y; if(freq_x!=0){ if(freq_x==-1){ x_x = x; freq_x=1; } else { if(x_x!=x) freq_x = 0; } } if(freq_y!=0){ if(freq_y==-1){ freq_y=1; y_y = y; } else { if(y_y!=y) freq_y=0; } } } if(freq_y || freq_x) cout<<"YES"; else cout<<"NO"; return 0; }