#include <bits/stdc++.h>
using namespace std;
int main() {
  while (true) {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
    if (cin.fail()) break;
    double a1 = ya - yc;
    double b1 = xc - xa;
    double c1 = ya * (xa - xc) - xa * (ya - yc);
    double a2 = yb - yd;
    double b2 = xd - xb;
    double c2 = yb * (xb - xd) - xb * (yb - yd);
    if ((a1 * xb + b1 * yb + c1) * (a1 * xd + b1 * yd + c1) > 0 &&
        (a2 * xa + b2 * ya + c2) * (a2 * xc + b2 * yc + c2) < 0)
      cout << "NO" << endl;
    else if ((a1 * xb + b1 * yb + c1) * (a1 * xd + b1 * yd + c1) < 0 &&
             (a2 * xa + b2 * ya + c2) * (a2 * xc + b2 * yc + c2) > 0)
      cout << "NO" << endl;
    else if ((a1 * xb + b1 * yb + c1) * (a1 * xd + b1 * yd + c1) > 0 &&
             (a2 * xa + b2 * ya + c2) * (a2 * xc + b2 * yc + c2) > 0)
      cout << "YES" << endl;
  }
  return 0;
}
