#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);
}
double norm2() { return x * x + y * y; }
};
inline double cross(pt a, pt b) { return a.x * b.y - a.y * b.x; }
bool half(pt p) {
return p.y > 0.0 || (p.y == 0.0 && p.x < 0.0);
}
vector<pt> point;
void polar_sort(vector<pt> &v) { // sort points in counterclockwise
sort(v.begin(), v.end(), [](pt a,pt b) {
return make_tuple(half(a), 0.0, a.norm2()) < make_tuple(half(b), cross(a, b), b.norm2());
});
}
// 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;
polar_sort(point);
double area = get();
point.push_back(p11);
polar_sort(point);
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();
}
}