// #pragma GCC optimize("O3,unroll-loops,Ofast")
// #pragma GCC target("avx2")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
using namespace std;
using pii = pair<int, int>;
using tup = tuple<int, int, int>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T> using ordered_set = tree<T, null_type,
less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int inf = 1e18;
const int mod = 1000000007;
const double eps = 1e-9;
const int N = 200005;
void preprocess() {}
// AId the code
int px[N], py[N];
int triangleArea(int x1, int y1, int x2, int y2, int x3, int y3) {
int area = abs(x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2));
return area;
}
bool onLine(int x1, int y1, int x2, int y2, int px, int py) {
if (x1 == x2) {
return px == x1 && py >= min(y1, y2) && py <= max(y1, y2);
}
if (y1 == y2) {
return py == y1 && px >= min(x1, x2) && px <= max(x1, x2);
}
if ((px >= min(x1, x2) && px <= max(x1, x2)) &&
(py >= min(y1, y2) && py <= max(y1, y2))) {
int area = triangleArea(x1, y1, x2, y2, px, py);
return area == 0;
}
return false;
}
int polygonArea(int n, int px[], int py[]) {
int area = 0;
for(int i = 1; i < n; i++) {
area += px[i] * py[i+1] - px[i+1] * py[i];
}
area += px[n] * py[1] - px[1] * py[n];
return abs(area);
}
void solve(int tc) {
int n;
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> px[i] >> py[i];
}
int x, y;
cin >> x >> y;
// bool onAnyLine = false;
// for(int i = 1; i <= n; i++) {
// int j = (i == n) ? 1 : i + 1;
// if(onLine(px[i], py[i], px[j], py[j], x, y)) {
// onAnyLine = true;
// break;
// }
// }
// if(onAnyLine) {
// cout << "NO" << endl;
// return;
// }
int totalArea = polygonArea(n, px, py);
int sumTriangleAreas = 0;
for(int i = 1; i <= n; i++) {
int j = (i == n) ? 1 : i + 1;
sumTriangleAreas += triangleArea(x, y, px[i], py[i], px[j], py[j]);
}
if(sumTriangleAreas == totalArea) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
int32_t main() {
cin.tie(NULL)->sync_with_stdio(false);
cout.precision(10);
preprocess();
int T = 1;
// cin >> T;
for (int i = 1; i <= T; i++) {
solve(i);
}
return 0;
}