#include <iostream>
using namespace std;

bool is_up (double x1, double y1, double x2, double y2, double px, double py) {
    if (x1 == x2) return px > x1;
    return (py > (y2 - y1) / (x2 - x1) * px + (x1 * y2 - x2 * y1) / (x1 - x2) );
}

int main() {
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        int up = 0;
        up += is_up(x1, y1, x2, y2, xp, yp);
        cout << up << endl;
        up += is_up(x3, y3, x2, y2, xp, yp);
        cout << up << endl;
        up += is_up(x1, y1, x3, y3, xp, yp);
        cout << up << endl;

        if (up == 1) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}