#include #define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--) #define forn(i, n) for(int i = 0; i < (int)(n); i++) #define for1(i, n) for(int i = 1; i <= (int)(n); i++) #define all(x) (x).begin(), (x).end() #define pb push_back #define mp make_pair #define x first #define y second using namespace std; typedef long double ld; typedef long long ll; typedef pair PII; typedef pair pii; typedef vector vi; typedef long long i64; typedef unsigned long long ull; template bool remin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } template bool remax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } int nxt() { int x; scanf("%d", &x); return x; } ll gcd(ll a, ll b) { a = abs(a); b = abs(b); while (b) { a %= b; swap(a, b); } return a; } typedef ld ptdata; struct pt { ptdata x, y, z; pt() { } pt(ptdata x, ptdata y, ptdata z) : x(x), y(y), z(z) { } inline pt operator-(const pt &r) const { return pt(x - r.x, y - r.y, z - r.z); } inline pt operator+(const pt &r) const { return pt(x + r.x, y + r.y, z + r.z); } inline pt operator*(const ld &r) const { return pt(x * r, y * r, z * r); } inline ptdata sqlen() const { return abs(x * x + y * y + z * z); } ld len() const { return sqrtl(sqlen()); } inline bool operator<(const pt &r) const { if (x != r.x) return x < r.x; return y < r.y; } inline bool operator==(const pt &r) const { return x == r.x && y == r.y; } }; ostream &operator << (ostream &os, const pt &p) { return os << "(" << p.x << "," << p.y << ")"; } inline pt cross(const pt &l, const pt &r) { return pt(l.y * r.z - l.z * r.y, l.z * r.x - l.x * r.z, l.x * r.y - l.y * r.x); } inline ptdata dot(const pt &l, const pt &r) { return l.x * r.x + l.y * r.y + l.z * r.z; } ll pwmod(ll a, ll n, ll mod) { ll ret = 1; while (n) { if (n & 1) ret = ret * a % mod; a = a * a % mod; n >>= 1; } return ret; } template inline T sqr(T x) { return x * x; } bool remin(ll &x, ll y) { if (x > y) { x = y; return 1; } return 0; } void solve() { int n = nxt(); PII a[n]; forn(i, n) { a[i].x = nxt(); a[i].y = nxt(); } bool ok = true; for (int i = 0; i < n; ++i) { if (a[i].x != a[0].x) { ok = false; } } if (ok) { cout << "YES\n"; return; } ok = true; for (int i = 0; i < n; ++i) { if (a[i].y != a[0].y) { ok = false; } } if (ok) { cout << "YES\n"; return; } cout << "NO\n"; } int main() { #ifdef LOCAL freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(0); int t = 1;//nxt(); forn(i, t) { solve(); } //cerr << "Time " << clock() / (double) CLOCKS_PER_SEC << endl; return 0; }