#include <bits/stdc++.h>
const double eps = 1e-6;
struct node {
  double x, y;
  node(double X = 0, double Y = 0) {
    x = X;
    y = Y;
  };
  node operator-(node a) { return node(x - a.x, y - a.y); }
} v, p, ms, mt, ws, wt;
double Min(double a, double b) { return a < b ? a : b; }
double Max(double a, double b) { return a > b ? a : b; }
double xj(node a, node b) { return a.x * b.y - a.y * b.x; }
int cross(node s, node t, node l, node r) {
  if ((s.x - l.x) * (t.y - s.y) == (s.y - l.y) * (t.x - s.x) &&
      (s.x - r.x) * (t.y - s.y) == (s.y - r.y) * (t.x - s.x)) {
    if (Min(s.x, t.x) < Max(r.x, l.x) && Min(r.x, l.x) < Max(s.x, t.x))
      return 0;
    return -1;
  }
  double xx = xj(t - s, l - s) * xj(t - s, r - s);
  double yy = xj(r - l, s - l) * xj(r - l, t - l);
  if (xx < eps && yy < eps) return 1;
  return -1;
}
bool direct() {
  if (cross(v, p, ws, wt) == -1 && cross(v, p, ms, mt) <= 0) return true;
  return false;
}
bool mirror() {
  if (cross(v, p, ms, mt) == 0) return false;
  double b = mt.x - ms.x;
  double a = ms.y - mt.y;
  double c = ms.x * (mt.y - ms.y) - ms.y * (mt.x - ms.x);
  node v0(
      ((b * b - a * a) * v.x - 2 * a * b * v.y - 2 * a * c) / (a * a + b * b),
      ((a * a - b * b) * v.y - 2 * a * b * v.x - 2 * b * c) / (a * a + b * b));
  if (cross(v0, p, ms, mt) < 1) return false;
  double A = p.y - v0.y;
  double B = v0.x - p.x;
  double C = p.x * (v0.y - p.y) - p.y * (v0.x - p.x);
  double x = (b * C - B * c) / (B * a - A * b),
         y = (A * c - C * a) / (B * a - A * b);
  node o(x, y);
  if (cross(v, o, ws, wt) >= 0 || cross(o, p, ws, wt) >= 0) return false;
  return true;
}
int main() {
  scanf("%lf%lf", &v.x, &v.y);
  scanf("%lf%lf", &p.x, &p.y);
  scanf("%lf%lf%lf%lf", &ws.x, &ws.y, &wt.x, &wt.y);
  scanf("%lf%lf%lf%lf", &ms.x, &ms.y, &mt.x, &mt.y);
  if (direct()) {
    puts("YES");
    return 0;
  }
  if (mirror()) {
    puts("YES");
    return 0;
  }
  puts("NO");
  return 0;
}
