#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout << #a << " : " << a << endl;
vector<pair<ll,ll>> point;
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].second);
}
}
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});
}
pair<ll,ll> p1;
cin >> p1.first >> p1.second;
ll area = get();
point.push_back(p1);
ll area_upd = get();
if ( area_upd > area ) {
cout << "NO" << '\n';
}
else {
cout << "YES" << '\n';
}
}
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();
}
}