#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
const double inf = 1e6;
bool zero(double x) { return fabs(x) < eps; }
struct point {
  double x, y;
  point(double _x = 0, double _y = 0) { x = _x, y = _y; }
  point operator-(const point &a) { return point(x - a.x, y - a.y); }
  void input() { scanf("%lf%lf", &x, &y); }
} v, p, w[2], m[2];
point zhuixian(point a, point b) {
  point c = b - a;
  swap(c.x, c.y);
  c.y = -c.y;
  return c;
}
double mult(point a, point b, point c) {
  return (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x);
}
bool inter(point a, point b, point c, point d) {
  if (min(a.x, b.x) > max(c.x, d.x) || min(a.y, b.y) > max(c.y, d.y) ||
      min(c.x, d.x) > max(a.x, b.x) || min(c.y, d.y) > max(a.y, b.y))
    return 0;
  double h, i, j, k;
  h = (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
  i = (b.x - a.x) * (d.y - a.y) - (b.y - a.y) * (d.x - a.x);
  j = (d.x - c.x) * (a.y - c.y) - (d.y - c.y) * (a.x - c.x);
  k = (d.x - c.x) * (b.y - c.y) - (d.y - c.y) * (b.x - c.x);
  return h * i <= eps && j * k <= eps;
}
point intersection(point u1, point u2, point v1, point v2) {
  point ret = u1;
  double t = ((u1.x - v1.x) * (v1.y - v2.y) - (u1.y - v1.y) * (v1.x - v2.x)) /
             ((u1.x - u2.x) * (v1.y - v2.y) - (u1.y - u2.y) * (v1.x - v2.x));
  ret.x += (u2.x - u1.x) * t;
  ret.y += (u2.y - u1.y) * t;
  return ret;
}
point p_l_p(point p1, point l1, point l2) {
  point ret;
  if (l1.x > l2.x - eps && l1.x < l2.x + eps) {
    ret.x = (2 * l1.x - p1.x);
    ret.y = p1.y;
  } else if (l1.y > l2.y - eps && l1.y < l2.y + eps) {
    ret.y = (2 * l1.y - p1.y);
    ret.x = p1.x;
  } else {
    double k = (l1.y - l2.y) / (l1.x - l2.x);
    ret.x =
        (2 * k * k * l1.x + 2 * k * p1.y - 2 * k * l1.y - k * k * p1.x + p1.x) /
        (1 + k * k);
    ret.y = p1.y - (ret.x - p1.x) / k;
  }
  return ret;
}
int main() {
  while (scanf("%lf%lf", &v.x, &v.y) != EOF) {
    p.input();
    for (int i = 0; i < 2; i++) w[i].input();
    for (int i = 0; i < 2; i++) m[i].input();
    if (!inter(v, p, m[0], m[1]) && !inter(v, p, w[0], w[1])) {
      puts("YES");
      continue;
    }
    if (zero(mult(p, m[0], m[1])) && zero(mult(v, m[0], m[1]))) {
      if (inter(v, p, w[0], w[1]))
        puts("NO");
      else
        puts("YES");
    } else {
      if (inter(m[0], m[1], v, p)) {
        puts("NO");
        continue;
      }
      point p1 = p_l_p(p, m[0], m[1]);
      point zhui = zhuixian(m[0], m[1]);
      if (!inter(m[0], m[1], v, p1))
        puts("NO");
      else {
        point tmp = intersection(p1, v, m[0], m[1]);
        if (inter(w[0], w[1], tmp, v))
          puts("NO");
        else if (inter(w[0], w[1], tmp, p))
          puts("NO");
        else
          puts("YES");
      }
    }
  }
}
