#pragma comment(linker, "/stack:640000000") #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; const double EPS = 1e-9; const int INF = 0x7f7f7f7f; const double PI=acos(-1.0); #define READ(f) freopen(f, "r", stdin) #define WRITE(f) freopen(f, "w", stdout) #define MP(x, y) make_pair(x, y) #define PB(x) push_back(x) #define rep(i,n) for(int i = 1 ; i<=(n) ; i++) #define repI(i,n) for(int i = 0 ; i<(n) ; i++) #define FOR(i,L,R) for (int i = L; i <= R; i++) #define ROF(i,L,R) for (int i = L; i >= R; i--) #define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) #define ALL(p) p.begin(),p.end() #define ALLR(p) p.rbegin(),p.rend() #define SET(p) memset(p, -1, sizeof(p)) #define CLR(p) memset(p, 0, sizeof(p)) #define MEM(p, v) memset(p, v, sizeof(p)) #define getI(a) scanf("%d", &a) #define getII(a,b) scanf("%d%d", &a, &b) #define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c) #define getL(a) scanf("%lld",&a) #define getLL(a,b) scanf("%lld%lld",&a,&b) #define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c) #define getC(n) scanf("%c",&n) #define getF(n) scanf("%lf",&n) #define getS(n) scanf("%s",n) #define bitCheck(a,k) ((bool)(a&(1<<(k)))) #define bitOff(a,k) (a&(~(1<<(k)))) #define bitOn(a,k) (a|(1<<(k))) #define bitFlip(a,k) (a^(1<<(k))) #define iseq(a,b) (fabs(a-b) #define vii vector < vector < int > > #define pii pair< int, int > #define ff first #define ss second #define ll long long #define ull unsigned long long template< class T > inline T _abs(T n) { return ((n) < 0 ? -(n) : (n)); } template< class T > inline T _max(T a, T b) { return (!((a)<(b))?(a):(b)); } template< class T > inline T _min(T a, T b) { return (((a)<(b))?(a):(b)); } template< class T > inline T _swap(T &a, T &b) { a=a^b;b=a^b;a=a^b;} template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); } template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); } template string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); } #ifdef mamun #define debug(args...) {cerr<<"*: "; dbg,args; cerr< debugger& operator , (const T& v){ cerr< A, B // point A, B; // segment() {} // segment( point P1, point P2 ) { A = P1, B = P2; } //}; //inline line findPerpendicularLine( line L, point P ) { // line res; //line perpendicular to L, and intersects with P // res.a = L.b, res.b = -L.a; // res.c = -res.a * P.x - res.b * P.y; // return res; //} //inline bool eq(double a, double b) { return fabs( a - b ) < eps; } //two numbers are equal // //inline bool intersection( line L1, line L2, point &p ) { // double det = L1.a * L2.b - L1.b * L2.a; // if( eq ( det, 0 ) ) return false; // p.x = ( L1.b * L2.c - L2.b * L1.c ) / det; // p.y = ( L1.c * L2.a - L2.c * L1.a ) / det; // return true; //} // //inline double Distance( point a, point b ) { // return sqrt( ( a.x - b.x ) * ( a.x - b.x ) + ( a.y - b.y ) * ( a.y - b.y ) ); //}inline double Distance( point P, line L ) { // return fabs( L.a * P.x + L.b * P.y + L.c ) / sqrt( L.a * L.a + L.b * L.b ); //} // // //inline double Distance( point P, segment S ) { // line L1 = line(S.A,S.B), L2; point P1; // L2 = findPerpendicularLine( L1, P ); // if( intersection( L1, L2, P1 ) ) // if( eq ( Distance( S.A, P1 ) + Distance( S.B, P1 ), Distance( S.A, S.B ) ) ) // return Distance(P,L1); // return min ( Distance( S.A, P), Distance( S.B, P) ); //} //point arr[15]; struct line // Creates a line with equation ax + by + c = 0 { int a, b, c; line() {} line( pii p1,pii p2 ) { a = p1.ss - p2.ss; b = p2.ff - p1.ff; c = p1.ff * p2.ss - p2.ff * p1.ss; } }; //bool colinear(int i,int j,int k) //{ // line xx(arr[i],arr[j]); // if(xx.a*arr[k].ff+xx.b*arr[k].ss+xx.c==0)return 1; // return 0; //} pii arr[15]; bool coline(int i,int j,int k) { return (arr[j].ss - arr[i].ss) * (arr[k].ff - arr[i].ff) == (arr[j].ss - arr[i].ff) * (arr[k].ss - arr[i].ss); } int main() { ///check for 0 or -1 if input not specified #ifdef mamun // READ("in.txt"); // WRITE("out.txt"); #endif // mamun while(~getI(n)) { rep(i,n)getII(arr[i].ff,arr[i].ss); bool ans1=true,ans2=true; rep(i,n) { if(i>1&&arr[i-1].ff!=arr[i].ff) { ans1=false; break; } } rep(i,n) { if(i>1&&arr[i-1].ss!=arr[i].ss) { ans2=false; break; } } if(ans1||ans2)puts("YES"); else puts("NO"); } return 0; }