#include #include #include #include #include #include #include #include #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; typedef long long ll; typedef unsigned long long ull; typedef double ld; typedef vector < long long > vll; typedef pair pll; typedef pair pii; typedef vector < int > vii; typedef complex < double > Point; #define csl ios_base::sync_with_stdio(false); cin.tie(NULL) #define mp make_pair #define fst first #define snd second #define prev PREV ll t, n, m, u, v, q, r, ql, qr, k, l, s, w, c, z, d, b; const int N = 2e5 + 500; const long long mod = 1e9 + 7; const long long INF = 1LL << 52LL; pll pt[N];; int main() { csl; cin >> n; for (int i = 1; i <= n; ++i) cin >> pt[i].fst >> pt[i].snd; bool x = true, y = true; for (int i = 2; i <= n; ++i) { if (pt[i].fst != pt[i - 1].fst) x = false; if (pt[i].snd != pt[i - 1].snd) y = false; } if (x || y) cout << "YES\n"; else cout << "NO\n"; return 0; }