#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define pb push_back #define mp make_pair #define fs first #define sc second #define sz(a) ((int) (a).size()) #define eprintf(...) fprintf(stderr, __VA_ARGS__) using namespace std; typedef long long int64; typedef long double ldb; const long double eps = 1e-9; const int inf = (1 << 30) - 1; const long long inf64 = ((long long)1 << 62) - 1; const long double pi = acos(-1); template T sqr (T x) {return x * x;} template T abs (T x) {return x < 0 ? -x : x;} int main () { // ios_base::sync_with_stdio(0); // freopen("input.txt", "rt", stdin); // freopen("output.txt", "wt", stdout); int n; cin >> n; int x0, y0; bool key_x = true, key_y = true; for (int i = 0; i < n; ++i) { int x, y; cin >> x >> y; if (i == 0) { x0 = x, y0 = y; } key_x &= (x == x0); key_y &= (y == y0); } cout << (key_x || key_y ? "YES\n" : "NO\n"); return 0; }