#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n;
m = n;
int x_min = INT_MAX, x_max = INT_MIN;
int y_min = INT_MAX, y_max = INT_MIN;
vector<pair<int, int>> v;
while (m--)
{
int x, y;
cin >> x >> y;
v.push_back({x, y});
x_min = min(x, x_min);
x_max = max(x, x_max);
y_min = min(y, y_min);
y_max = max(y, y_max);
}
int x, y;
cin >> x >> y;
// for(int i = 0; i < n; i++) {
// if((v[i].first == x && v[i+ 1].first == x) || (v[i].second == y && v[i+ 1].second == y)){
// cout << "YES" << endl;
// return 0;
// }
// }
// int area = 9;
// for (int i = 0; i < n - 1; i++)
// {
// area = (v[i].first * y + x * v[i + 1].second + v[i + 1].first * v[i].second) - (x * v[i].second + v[i + 1].first * y + v[i].first * v[i + 1].second);
// if (area == 0)
// {
// cout << "YES" << endl;
// return 0;
// }
// }
double slope1, slope2;
for (int i = 0; i < n - 1; i++)
{
if ((x - v[i].first) == 0)
{
slope1 = (x - v[i].first) / (y - v[i].second);
}
else
{
slope1 = (y - v[i].second) / (x - v[i].first);
}
if ((v[i + 1].first - x) == 0)
{
slope2 = (v[i + 1].first - x) / (v[i + 1].second - y);
}
else
{
slope2 = (v[i + 1].second - y) / (v[i + 1].first - x);
}
// cout << slope1 << endl;
// cout << slope2 << endl;
if (slope1 == slope2)
{
cout << "YES" << endl;
return 0;
}
}
int flag = 0;
for (auto &i : v)
{
if (i.first == x && i.second == y)
{
cout << "YES" << endl;
return 0;
}
}
if ((x > x_min && x < x_max) && (y > y_min && y < y_max))
{
cout << "YES" << endl;
}
else if ((x_max == x_min && x == x_min) || (y_max == y_min && y == y_min))
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}