#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout << #a << " : " << a << endl;
struct pt{
ll x, y;
pt(){
x = 0;
y = 0;
}
pt(ll x, ll y) : x(x), y(y){
}
pt operator - (const pt &a) const {
return pt(x - a.x, y - a.y);
}
pt operator * (const ll a) const {
return pt(x * a, y * a);
}
friend pt operator * (const ll &a, const pt &b){
return pt(a * b.x, a * b.y);
}
};
vector<pt> point;
inline ll cross(pt p1, pt p2){
return ((p1.x * p2.y ) - (p1.y * p2.x));
}
ll get(){
ll sum1 = 0, sum2 = 0;
int n = point.size();
for(int i = 0; i < n; i++){
sum1+= cross(point[i],point[(i+1)%n]);
}
ll ans = fabs(sum1);
//cout << ans << endl;
return ans;
}
void solve(){
int n; cin >> n;
for(int i = 1; i <= n; i++){
int x, y; cin >> x >> y;
pt p;
p.x = x; p.y = y;
point.push_back(p);
}
pair<ll,ll> p1;
cin >> p1.first >> p1.second;
pt p11;
p11.x = p1.first;
p11.y = p1.second;
//sort(point.begin(), point.end());
double area = get();
point.push_back(p11);
double area_upd = get();
//cout << area_upd << " " << area << endl;
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();
}
}