#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout << #a << " : " << a << endl;
vector<pair<ll,ll>> point;
pair<ll,ll> p;
ll tri_sum(pair<int,int> p1,pair<int,int> p2){
ll sum = (p1.first*p2.second + p2.first * p.second + p.first*p1.second);
sum -= (p1.second*p2.first + p2.second * p.first + p.second*p1.first);
return abs(sum);
}
ll get(){
ll sum1 = 0, sum2 = 0;
int n = point.size();
for(int i = 0; i < n; i++){
if ( i == n-1 ) {
sum1 += (1LL * point[i].first * point[0].second);
}
else{
sum1 += (1LL * point[i].first * point[i + 1].second);
}
if ( i == n-1 ) {
sum2 += (1LL * point[i].second * point[0].first);
}
else {
sum2 += (1LL * point[i].second * point[i + 1].first);
}
}
ll ans = abs(sum1 - sum2);
return ans;
}
void solve(){
int n; cin >> n;
for(int i = 1; i <= n; i++){
int x, y; cin >> x >> y;
point.push_back({x, y});
}
cin >> p.first >> p.second;
ll area = get();
ll area_upd = 0;
for(int i = 0; i < n;i++){
if(i == n-1){
area_upd += tri_sum(point[i],point[0]);
}
else
area_upd += tri_sum(point[i],point[i+1]);
}
if(area == area_upd){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tc = 1, cs = 0;
// cin >> tc;
while(tc--){
//cout << "Case # " << ++cs << ": " ;
solve();
}
}