#include<bits/stdc++.h>
using namespace std;
#define int long long
int area(int a, int b, int c, int d, int e, int f) {
int val = a * d + c * f + e * b - b * c - d * e - a * f;
return abs(val);
}
int f(int a, int b, int x1, int y1, int x2, int y2) {
int left = (b - y1) * (x1 - x2);
int right = (a - x1) * (y1 - y2);
if(left == right) return 1;
return 0;
}
void solve() {
int n;
cin >> n;
vector<int> x(n), y(n);
for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
int xx, yy;
cin >> xx >> yy;
int a = 0;
for (int i = 0; i + 1 < n; i++) {
a += x[i] * y[i + 1];
}
a += x[n - 1] * y[0];
for (int i = 0; i + 1 < n; i++) {
a -= y[i] * x[i + 1];
}
a -= x[0] * y[n - 1];
int b = 0;
for (int i = 0; i + 1 < n; i++) {
b += area(x[i], y[i], x[i + 1], y[i + 1], xx, yy);
}
b += area(x[0], y[0], x[n - 1], y[n - 1], xx, yy);
bool ok = 0;
for (int i = 0; i + 1 < n; i++) {
ok |= f(xx, yy,x[i], y[i], x[i + 1], y[i + 1]);
}
ok |= f(xx, yy,x[0], y[0], x[n -1], y[n - 1]);
if(ok) cout << "NO\n";
else if(abs(a) == b) {
cout << "YES\n";
}
else cout << "NO\n";
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
//cin>>t;
for(int tc = 1; tc <= t; tc++) {
// cout<<"Case "<<tc<<":";
solve();
}
}