#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define f(i,s,n) for(int i = s; i < n; i++)
// #define int long long
int getSign(int x1, int y1, int x2, int y2, int x3,int y3){
int dir = (y2 - y1) * (x3 - x2) - (y3 - y2) * (x2 - x1);
if(dir > 0)return 1;
if(dir < 0)return 2;
if(dir == 0)return 0;
}
void solve(){
int n;cin>>n;
vector<pair<int, int> > v;
for(int i = 0; i < n; i++){
int x,y;cin>>x>>y;
v.push_back({x, y});
}
int nx, ny;cin>>nx>>ny;
int hobe = getSign(nx, ny, v[0].first, v[0].second, v[1].first, v[1].second);
if(hobe == 0){cout<<"NO"<<nl;return;}
for(int i = 0; i < n; i++){
int tmp = getSign(nx, ny, v[i].first, v[i].second, v[(i + 1) % n].first, v[(i + 1) % n].second);
// cout<<tmp<<nl;
if(tmp != hobe){cout<<"NO"<<nl;return;}
}
cout<<"YES"<<nl;
}
signed main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int T = 1;
// cin>>T;
for(int tc = 1; tc <= T; tc++){
solve();
}
}