#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,x,y,z,w; cin >> n; bool vert=0,hor=0; cin >> x >>y >> z >> w; if(x==z) vert = 1; if(y==w) hor = 1; n-=2; if(!vert && !hor ) {cout << "NO" << endl;return 0;} while(n--){ cin >> z >> w; if(vert){ if(x!=z) {cout << "NO" << endl;return 0;} } else{ if(y!=w){cout << "NO" << endl;return 0;} } } cout << "YES" << endl; return 0; }