#include <iostream>
#include <cmath>
typedef double long dl;
using namespace std;
const double E = 1e-6;
bool on_edge(dl x, dl y, dl x1, dl y1, dl x2, dl y2) {
bool res = false;
if (fabs(x2 - x1) < E) {
if (fabs(x - x1) < E && y > min(y1, y2) - E && y - E < max(y1, y2)) res = true;
} else {
x -= x1;
y -= y1;
x2 -= x1;
y2 -= y1;
if (x - E < max(x1, x2) && x > min(x1, x2) - E && fabs(x2 * y - y2 * x) < E) {
res = true;
}
}
return res;
}
bool cross(dl x0, dl y0, dl x1, dl y1, dl x2, dl y2){
return (y1 < y0 && y2 > y0 - E || y2 < y0 && y1 > y0 - E) && (y0 * (x1 - x2) + y1 * x2 - x1 * y2) / (y1 - y2) < x0;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
dl x0, y0, xs, ys, xt, yt, xi, yi;
int n;
cin >> n >> x0 >> y0;
cin >> xs >> ys;
xt = xs;
yt = ys;
bool par_am = false;
bool on_side = false;
n--;
while (n-- && !on_side) {
cin >> xi >> yi;
if (on_edge(x0, y0, xt, yt, xi, yi)) {
on_side = true;
}
if (cross(x0, y0, xt, yt, xi, yi)) {
par_am = !par_am;
}
xt = xi;
yt = yi;
}
if (on_edge(x0, y0, xt, yt, xs, ys)) {
on_side = true;
}
if (cross(x0, y0, xt, yt, xs, ys)) {
par_am = !par_am;
}
cout << (par_am || on_side ? "YES" : "NO");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPiAKI2luY2x1ZGUgPGNtYXRoPgp0eXBlZGVmIGRvdWJsZSBsb25nIGRsOwp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBkb3VibGUgRSA9IDFlLTY7CmJvb2wgb25fZWRnZShkbCB4LCBkbCB5LCBkbCB4MSwgZGwgeTEsIGRsIHgyLCBkbCB5MikgewogICAgYm9vbCByZXMgPSBmYWxzZTsKICAgIGlmIChmYWJzKHgyIC0geDEpIDwgRSkgewogICAgICAgIGlmIChmYWJzKHggLSB4MSkgPCB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