#include using namespace std; typedef long long int ll; typedef unsigned long long int ull; const int MOD = 1000000007; #define op(x) (x&(-x)) #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define trace5(a, b, c, d, e) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl; #define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl; #define FOR(i,a,b) for(int i=a;i p[15]; int main() { int n; cin>>n; FOR(i,0,n) { int x,y; cin>>x>>y; p[i].first = x; p[i].second = y; } bool flag1 = true, flag2 = true; FOR(i,1,n) { if(p[i].first!=p[i-1].first) { flag1=false; break; } } FOR(i,1,n) { if(p[i].second!=p[i-1].second) { flag2=false; break; } } if(flag1||flag2) cout<<"YES"<