//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<numeric>
//stl
#include<vector>
#include<list>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<stack>
#include<queue>
#include<deque>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll>vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef list<int> li;
typedef set<int> sti;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef unordered_map<int, int> umii;
typedef unordered_map<ll, ll> umll;
typedef unordered_set<ll> us;
typedef priority_queue<ll> pq;
typedef deque<ll> dq;
#define nl "\n"
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define Yes cout<<"YES\n";
#define No cout<<"NO\n";
#define yes cout<<"Yes\n";
#define no cout<<"No\n";
#define F first
#define sc second
#define all(v) v.begin(), v.end()
#define sortv(v) sort(v.begin(), v.end());
#define rsort(v) sort(v.rbegin(), v.rend());
#define revv(v) reverse(v.begin(), v.end());
const int N=1e6+9;
const int mod1=1e9+7, mod2=1e9+9;
const int base1=29, base2=67;
const long long int inf=1e18;
const long double eps=1e-9;
#define saiful_islam_bk
struct point{
double x, y;
point(){x=y=0.0;}
point(double _x, double _y) : x(_x), y(_y) {}
bool operator<(point p) const{
if(fabs(x-p.x)>eps) return x<p.x;
return y<p.y;
}
bool operator==(point p) const{
return fabs(x-p.x)<eps && fabs(y-p.y)<eps;
}
};
ll ori(point a, point b, point c){
ll val=(c.x-b.x)*(b.y-a.y)-(b.x-a.x)*(c.y-b.y);
return (val?val/abs(val):0);
}
bool onseg(point a, point b, point c){
return c.x<=max(a.x, b.x) && c.x>=min(a.x, b.x) &&
c.y<=max(a.y, b.y) && c.y>=min(a.y, b.y);
}
bool is_intersect(point a, point b, point c, point d){
return ori(a, b, c)!=ori(a, b, d) && ori(c, d, a)!=ori(c,
d, b);
return ori(a, b, c)==0 && onseg(a, b, c);
return ori(a, b, d)==0 && onseg(a, b, d);
return ori(c, d, a)==0 && onseg(c, d, a);
return ori(c, d, b)==0 && onseg(c, d, b);
return 0;
}
void solve(){
ll n, m=0, k=0; cin>>n;
vector<point>p(n);
for(ll i=0; i<n; i++){
cin>>p[i].x>>p[i].y;
}
point X; cin>>X.x>>X.y;
point Y; Y.x=1e9+5; Y.y=X.y+1;
ll ans=0;
for(ll i=0; i<n; i++){
if(is_intersect(p[i], p[(i+1)%n], X, Y)){
ans++;
}
}
if(ans&1) Yes
else No
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
saiful_islam_bk
ll test=1;
//cin>>test;
for(ll ii=1; ii<=test; ii++){
//cout<<"Case "<<ii<<": ";
solve();
}
}