#include using namespace std; #define ll long long #define mod 1000000009 #define eps 1e-13 #define PI 3.14159265359 #define N 1000009 #define INF 1000000011 #define INFLL 1000000000000000011 #define space printf(" ") #define endl printf("\n") #define vi vector #define vll vector #define vc vector #define vs vector #define pii pair #define pll pair #define pil pair #define pli pair #define pcc pair #define mp make_pair #define F first #define S second #define pb(x) push_back(x) #define fo(i,a,n) for(i = a; i < n; i++) #define sd(x) scanf("%d", &(x)) #define pd(x) printf("%d", (x)) #define pdn(x) printf("%d\n", (x)) #define sld(x) scanf("%lld", &(x)) #define pld(x) printf("%lld", (x)) #define pldn(x) printf("%lld\n", (x)) #define slf(x) scanf("%llf", &(x)) #define plf(x) printf("%.9llf", (x)) #define plfn(x) printf("%.9llf\n", (x)) #define sch(x) scanf("%c", &(x)) #define pch(x) printf("%c", (x)) #define pchn(x) printf("%c\n", (x)) #define gtl(x) getline(cin, (x)) #define flsh fflush(stdout) #define sws ios::sync_with_stdio(false); cin.tie(0) #define gcd __gcd #define clr(x) memset(x,0,sizeof(x)) #define all(a) (a).begin(), (a).end() #define MOD 1000000009 /*ll gcd(ll a, ll b) { if(b == 0) return a; return gcd(b, a%b); }*/ ll modx(ll Base, ll exponent) { ll ans = 1; if(Base == 1) return Base; while(exponent) { if(exponent & 1) ans = (ans * Base)%mod; Base = (Base * Base)%mod; exponent = exponent >> 1; } return ans; } ll inmodx(ll num) { return (modx(num, 1000000005LL)); } bool cmp() { return false; } int main() { sws; int n, x, y, a, b, i; bool xz = true, yz = true; cin >> n; cin >> x >> y; fo(i,1,n) { cin >> a >> b; if(a != x) xz = false; if(b != y) yz = false; } if(xz || yz) cout << "YES\n"; else cout << "NO\n"; return 0; }