#include #include #include #include #include using namespace std; int main() { int n, x, y, sx, sy; cin >> n; cin >> sx >> sy; bool isHor = true, isVer = true; while(--n) { cin >> x >> y; if(sx != x) isHor = false; if(sy != y) isVer = false; } cout << ((isHor || isVer) ? "YES" : "NO"); return 0; }