#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool checkLineVer(int x, int y, int z, int a, int check){ if(x == z && x == check){ return true; } return false; } bool checkLineHor(int x, int y, int z, int a, int check){ if(y == a && y == check){ return true; } return false; } int main(){ int n; cin >> n; int a, b; a = b =0; bool ver = false; bool check = false; for(int a0 = 0; a0 < n; a0++){ int x; int y; cin >> x >> y; if(a0 != 0){ if(check == false) break; if(ver == true) check = checkLineVer(x, y, a, b, x); else check = checkLineHor(x, y, a, b, x); } a = x; b = y; if(a0 == 0){ check = checkLineVer(x, y, a, b, x); if(check == true) ver = true; else{ check = checkLineHor(x, y, a, b, x) ; } } } if(check == true) cout << "YES"; else cout << "NO"; return 0; }