#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);
}
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);
if(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();
}
}