#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;
}