#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define fri(a,b) for(ll i = a; i<b; i++)
#define frj(a,b) for(ll j = a; j <b; j++)
#define frk(a,b) for(ll k = a; k <b; k++)
#define rfri(a,b) for(ll i = a; i>=b; i--)
using namespace std;
int main()
{
ios_base:: sync_with_stdio(false);
cin.tie(NULL);
ll T = 1;
// cin >> T;
while(T--)
{
ll x,y,n;
cin >> n;
bool ps = 0;
vector < pair <ll,ll> > v;
ll minx = INT_MAX;
ll maxx = INT_MIN;
ll miny = INT_MAX;
ll maxy = INT_MIN;
ll j = 0;
while(n--)
{
ll x1,y1;
cin >> x1 >> y1;
if(x1 > maxx) maxx = x1;
if(x1 < minx) minx = x1;
if(y1 < miny) miny = y1;
if(y1 > maxy) maxy = y1;
v.pb({x1,y1});
}
cin >> x >> y;
ll first = 0;
ll second = 0;
v.push_back({v[0].first,v[0].second});
fri(0,v.size()-1)
{
first += v[i].first*v[i+1].second;
}
// cout << first << "\n";
fri(0,v.size()-1)
{
second += v[i].second*v[i+1].first;
}
// cout << second << "\n";
ll bohuvuj = abs(first - second);
// cout << bohuvuj << "\n";
ll total = 0;
fri(0,v.size()-1)
{
frj(i+1,v.size() - 1)
{
vector < pair <ll,ll> > t;
t.pb({v[i].first,v[i].second});
t.pb({v[j].first, v[j].second});
t.pb({x,y});
t.pb({v[i].first,v[i].second});
ll f = 0;
ll s = 0;
for(ll k = 0 ; k< t.size()-1; k++)
{
f += t[k].first*t[k+1].second;
s += t[k].second*t[k+1].first;
}
total += abs(f-s);
}
}
if(total != bohuvuj) no
else
{
if(total != 0) yes
else
{
ll y2 = ((v[1].second-v[0].second)/(v[1].first-v[0].first))*(x-v[0].first) + v[0].second;
if(y == y2 && y <= maxy && y >= miny && x>= minx && x<= maxx) yes
else no
}
}
}
}