#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-6;
int main() {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  while (cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd) {
    double a = (xc - xa) * (yd - ya) - (yc - ya) * (xd - xa);
    double b = (xc - xa) * (yb - ya) - (yc - ya) * (xb - xa);
    double c = (xd - xb) * (ya - yb) - (yd - yb) * (xa - xb);
    double d = (xd - xb) * (yc - yb) - (yd - yb) * (xc - xb);
    if (a * b <= 0.0 && c * d <= 0.0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
