import std.stdio;
import std.conv;
import std.string;
import std.algorithm;
import std.array;
import std.math;

double cross(cdouble a, cdouble b) {
  return (a * b.conj).im;
}

void main()
{
	foreach (line; stdin.byLine) {
    auto a = line.chomp.split.map!(to!double).array;
    cdouble ps[8];
    ps[0] = a[0] + a[1] * 1i;
    ps[1] = a[0] + a[3] * 1i;
    ps[2] = a[2] + a[3] * 1i;
    ps[3] = a[2] + a[1] * 1i;
    ps[4] = a[4] + a[5] * 1i;
    ps[5] = a[4] + a[7] * 1i;
    ps[6] = a[6] + a[7] * 1i;
    ps[7] = a[6] + a[5] * 1i;

    bool f;
    foreach (j; 4..8) {
      int cnt;
      foreach (i; 0..4) {
        if (cross(ps[(i+1)%4]-ps[i], ps[i]-ps[j]-ps[j]) <= 0) {
          cnt++;
        }
      }
      if (cnt == 4) f = 1;
    }
    if (f) writeln("YES");
    else writeln("NO");
  }
}