/*============================================================================ * Remember, Hope is a good thing... May be the best of things... And No Good thing ever Dies !!! * Author : Ranit Debnath Akash Email : ranitid12@gmail.com Varsity : SUST - 2012 - 43 Problem Name : Time Limit : .000s Description : ============================================================================*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(I,A,B) for(int I = (A); I < (B); ++I) #define RREP(I,A,B) for(int I = (A); I > (B); --I) #define REPE(I,A,B) for(int I = (A); I <= (B); ++I) #define RREPE(I,A,B) for(int I = (A); I >=(B); --I) #define SZ(x) (int)x.size() #define PP() pop_back() #define PB(x) push_back(x) #define SF scanf #define PF printf #define SSF sscanf #define RSRT(x) sort(x.rbegin(), x.rend()) #define SRT(x) sort(x.begin(), x.end()) #define mem(name, value) memset(name, value, sizeof(name)) #define oo 1000000050 #define oo2 2000000050 using namespace std; int cases=1; typedef pair PII; typedef map MSTI; typedef map MIST; typedef map MCI; typedef map MIC; typedef map MCC; typedef map MII; typedef map MSTST; typedef map, int> MVSTI; typedef vectorVI; typedef vectorVST; typedef vectorVC; typedef long long LL; typedef unsigned long long ULL; typedef unsigned int UI; typedef double DB; //typedef char C; //typedef string S; #define CSPRINT printf("Case %d:", t); #define NL puts(""); #define FR first #define SC second #define MP make_pair #define ins insert #define IT iterator #define all(v) v.begin(), v.end() #define ssort(v) stable_sort(v.begin(), v.end()) #define LB lower_bound #define UB upper_bound #define POPC __builtin_popcount #define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i) #define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++i) #define TEMPLATE template //variables and functions const double EPS = 1E-10; const double PI = 2.0 * acos(0.0); const int CHAR_INF = 0x7F; const int INT_INF = 0x7F7F7F7F; const long long LONG_INF = 0X7F7F7F7F7F7F7F7F; TEMPLATE inline T sqr(T n) { return n * n; } TEMPLATE inline T pmod(T n, T m) { return ((n % m) + m) % m; } TEMPLATE inline T gcd(T a, T b) { while(b) b ^= a ^= b ^= a %= b; return a; } TEMPLATE inline T lcm(T a, T b) { return a * (b / gcd(a, b)); } TEMPLATE T power(T n, T p) { if(!p) return 1; else { T res = sqr(power(n, p>>1)); if(p&1) res*=n; return res; } } TEMPLATE T bigmod(T n, T p, T m) { if(!p) return 1; else { T r = sqr(bigmod(n, p>>1, m))%m; if(p&1) r = (r*n)%m; return r; } } TEMPLATE T exgcd(T a,T b,T& x,T& y) { if(!b) { x=1; y=0; return a; } else { T g = exgcd(b, a%b, y, x); y -= (a/b)*x; return g; } } TEMPLATE T modinv(T a, T m) { T x, y; exgcd(a, m, x, y); return pmod(x, m); } inline double hypot(double x, double y) { return sqrt(sqr(x) + sqr(y)); } inline DB distFind(int x1, int y1, int x2, int y2) { DB x = (DB) x1 - (DB) x2; DB y = (DB) y1 - (DB) y2; return sqrt((x*x)+(y*y)); } template inline void deb(T1 e) { cout << e << endl; } template inline void deb(T1 e1, T2 e2) { cout << e1 << " " << e2 << endl; } template inline void deb(T1 e1, T2 e2, T3 e3) { cout << e1 << " " << e2 << " " << e3 << endl; } //int dx[4] = {+0,-1,+0,+1}, dy[4] = {-1,+0,+1,+0}; /*row and column moves*/ //int dx[8] = {-1,-1,-1,+0,+1,+1,+1,+0}, dy[8] = {-1,0,+1,+1,+1,0,-1,-1};/*8-direction*/ /* knight moves: dx[8] = {-1,-2,-2,-1,+1,+2,+2,+1}; dy[8] = {-2,-1,+1,+2,+2,+1,-1,-2}; */ /* Grid rotation: */ /* (col-j, i), (row-i, col-j), (j, col-i); */ struct data { int x, y; }; //typedef vector vt; //typedef vector vii; FILE *fp, *fp2; #define M 200000+50 int arr[M], tn, tc; data darr[15]; int main() { int tests, q; int a, b; // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); // SF("%d", &tests); // REPE(t, 1, tests) while ( SF("%d", &tn) ==1 ) { REP(i, 0, tn) { SF("%d %d", &darr[i].x, &darr[i].y); } bool fl=1; REP(i, 0, tn) { REP(j, i+1, tn) { if(darr[i].x == darr[j].x || darr[i].y == darr[j].y) continue; else fl=false; } } if(fl) PF("YES\n"); else PF("NO\n"); } return 0; } /* Copyright (C) 2016, RanitDebnathAkash */