#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
typedef unsigned long long int ull;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pi;
typedef pair<char, ll> pci;
typedef vector<pi> vii;
typedef map<ll, ll> mi;
typedef map<char, ll> mci;
typedef set<ll> seti;
typedef set<char> setc;
typedef unordered_set<ll> useti;
typedef unordered_set<char> usetc;
#define sz size()
#define ins insert
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define nl << "\n";
#define NO cout << "NO" nl
#define YES cout << "YES" nl
#define all(x) x.begin(), x.end()
#define db(x) cout << #x << " = " << x nl
#define input(x) for (auto &a : x) cin >> a;
#define view(x) cout << #x << ": " nl for (auto &a : x) {cout << a << " ";} cout nl
#define viewp(x) cout << #x << ": " nl for (auto &a : x) {cout << "{" << a.first << ", " << a.second << "} " nl} cout nl
lld triangle(lld x1, lld y1, lld x2, lld y2, lld x3, lld y3) {
return (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0;
}
void solve() {
int n;
cin >> n;
vi a(n), b(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
int x, y;
cin >> x >> y;
lld sum1 = 0, sum2 = 0;
for (int i = 0; i < n; i++) {
sum1 += a[i] * b[(i + 1) % n];
sum2 += b[i] * a[(i + 1) % n];
}
lld poly_area = abs(sum1 - sum2) / 2.0;
lld triangle_area = 0.0;
for (int i = 0; i < n; i++) {
int x1 = a[i], y1 = b[i];
int x2 = a[(i + 1) % n], y2 = b[(i + 1) % n];
int x3 = x, y3 = y;
triangle_area += triangle(x1, y1, x2, y2, x3, y3);
}
if (triangle_area == poly_area) {
cout << "YES" << '\n';
} else {
cout << "NO" << '\n';
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll t = 1;
//cin >> t;
while (t--) {
solve();
}
return 0;
}