#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
struct PT {
double x, y;
PT() { x = 0, y = 0; }
PT(double x, double y) : x(x), y(y) {}
PT operator + (const PT &a) const { return PT(x + a.x, y + a.y); }
PT operator - (const PT &a) const { return PT(x - a.x, y - a.y); }
};
inline double cross(PT a, PT b) { return a.x * b.y - a.y * b.x; }
bool is_point_on_seg(PT a, PT b, PT p) {
if (fabs(cross(p - b, a - b)) < eps) {
if (p.x < min(a.x, b.x) - eps || p.x > max(a.x, b.x) + eps) return false;
if (p.y < min(a.y, b.y) - eps || p.y > max(a.y, b.y) + eps) return false;
return true;
}
return false;
}
bool is_point_on_polygon(vector<PT> &p, const PT& z) {
int n = p.size();
for (int i = 0; i < n; i++) {
if (is_point_on_seg(p[i], p[(i + 1) % n], z)) return 1;
}
return 0;
}
int winding_number(vector<PT> &p, const PT& z) {
if (is_point_on_polygon(p, z)) return 1e9;
int n = p.size(), ans = 0;
for (int i = 0; i < n; ++i) {
int j = (i + 1) % n;
bool below = p[i].y < z.y;
if (below != (p[j].y < z.y)) {
auto orient = (p[j].y - p[i].y) * (z.x - p[i].x) > (z.y - p[i].y) * (p[j].x - p[i].x);
if (below == orient) ans += below ? 1 : -1;
}
}
return ans;
}
// From template: -1 if strictly inside, 0 if on the polygon, 1 if strictly outside
int is_point_in_polygon(vector<PT> &p, const PT& z) {
int k = winding_number(p, z);
return k == 1e9 ? 0 : k == 0 ? 1 : -1;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<PT> path(n);
for(int i = 0; i < n; i++) {
cin >> path[i].x >> path[i].y;
}
PT novita;
cin >> novita.x >> novita.y;
// -1 means strictly inside -> YES
// 0 means on polygon -> NO
// 1 means strictly outside -> NO
cout << (is_point_in_polygon(path, novita) == -1 ? "YES\n" : "NO\n");
return 0;
}