#include <iostream>
using namespace std;
struct point {
int x;
int y;
};
int f (point *p, int N, int x, int y) {
int i1, i2, n, S, S1, S2, S3, flag;
for (n = 0; n < N; n++) {
flag = 0;
i1 = n < N-1 ? n + 1 : 0;
while (flag == 0) {
i2 = i1 + 1;
if (i2 >= N)
i2 = 0;
if (i2 == (n < N-1 ? n + 1 : 0))
break;
S = abs (p[i1].x * (p[i2].y - p[n].y) +
p[i2].x * (p[n].y - p[i1].y) +
p[n].x * (p[i1].y - p[i2].y));
S1 = abs (p[i1].x * (p[i2].y - y) +
p[i2].x * (y - p[i1].y) +
x * (p[i1].y - p[i2].y));
S2 = abs (p[n ].x * (p[i2].y - y) +
p[i2].x * (y - p[n].y) +
x * (p[n].y - p[i2].y));
S3 = abs (p[i1].x * (p[n].y - y) +
p[n].x * (y - p[i1].y) +
x * (p[i1].y - p[n].y));
if (S == S1 + S2 + S3) {
flag = 1;
break;
}
i1 ++;
if (i1 >= N)
i1 = 0;
}
if (flag == 0)
break;
}
return flag;
}
int main() {
int n, x, y;
cin >> n >> x >> y;
point* p = new point[n];
for (int i = 0; i < n; i++)
cin >> p[i].x >> p[i].y;
cout << (f(p, n, x, y) ? "YES" : "NO");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IHBvaW50IHsKCWludCB4OwoJaW50IHk7Cn07CgppbnQgZiAocG9pbnQgKnAsIGludCBOLCBpbnQgeCwgaW50IHkpIHsKCWludCBpMSwgaTIsIG4sIFMsIFMxLCBTMiwgUzMsIGZsYWc7Cglmb3IgKG4gPSAwOyBuIDwgTjsgbisrKSB7CgkJZmxhZyA9IDA7CgkJaTEgPSBuIDwgTi0xID8gbiArIDEgOiAwOwoJCXdoaWxlIChmbGFnID09IDApIHsKCQkJaTIgPSBpMSArIDE7CgkJCWlmIChpMiA+PSBOKQoJCQkJaTIgPSAwOwoJCQlpZiAoaTIgPT0gKG4gPCBOLTEgPyBuICsgMSA6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