#include <bits/stdc++.h>
int a, b, c, d, e, f, g, h, i, j;
struct node {
  double x, y;
  double xx, yy;
  double A, B, C;
};
struct node x, y, yy, ww;
struct node wall, mirror;
int an;
double X(double x, double y, double xx, double yy) { return x * yy - y * xx; }
struct node JIE(struct node x) {
  struct node ii;
  ii.A = -(x.yy - x.y);
  ii.B = x.xx - x.x;
  ii.C = -(ii.A * x.x + ii.B * x.y);
  return ii;
} struct node Ver(struct node x) {
  struct node ii;
  ii.A = x.B;
  ii.B = -x.A;
  return ii;
}
struct node Fu(struct node x, struct node y) {
  struct node ii;
  ii.x = X(-x.C, x.B, -y.C, y.B) / X(x.A, x.B, y.A, y.B);
  ii.y = X(x.A, -x.C, y.A, -y.C) / X(x.A, x.B, y.A, y.B);
  return ii;
}
struct node DC(struct node x, struct node line) {
  struct node ch, G, u;
  line = JIE(line);
  ch = Ver(line);
  ch.C = -(x.x * ch.A + x.y * ch.B);
  G = Fu(line, ch);
  u.x = G.x + (G.x - x.x);
  u.y = G.y + (G.y - x.y);
  return u;
} int TEPAN(struct node x, struct node y, struct node line) {
  double ii, jj, kk;
  if (x.y == y.y) {
    if (line.y == line.yy) {
      if (line.y == x.y)
        return 3 + ((line.x - x.x) * (line.xx - x.x) < 0 ||
                    (line.x - y.x) * (line.xx - y.x) < 0 ||
                    (x.x - line.x) * (y.x - line.x) < 0 ||
                    (x.x - line.xx) * (y.x - line.xx) < 0);
      else
        return -1;
    } else
      return -1;
  } else if (fabs((y.y - x.y) / (y.x - x.x) -
                  (line.yy - line.y) / (line.xx - line.x)) < 1e-9) {
    return 3 + ((line.x - x.x) * (line.xx - x.x) < 0 ||
                (line.x - y.x) * (line.xx - y.x) < 0);
  }
  return -1;
}
int Jiao(struct node x, struct node y, struct node line) {
  double ii, jj, kk;
  struct node ch, G, H;
  int ok;
  ok = TEPAN(x, y, line);
  if (ok != -1) return ok;
  H = JIE(line);
  ch = x;
  ch.xx = y.x;
  ch.yy = y.y;
  ch = JIE(ch);
  G = Fu(ch, H);
  if (f == 1) ww = G;
  if ((x.x - G.x) * (y.x - G.x) <= 0 && (line.x - G.x) * (line.xx - G.x) <= 0 &&
      (x.y - G.y) * (y.y - G.y) <= 0 && (line.y - G.y) * (line.yy - G.y) <= 0)
    return 1;
  else
    return 0;
}
int main() {
  scanf("%lf%lf", &x.x, &x.y);
  scanf("%lf%lf", &y.x, &y.y);
  scanf("%lf%lf%lf%lf", &wall.x, &wall.y, &wall.xx, &wall.yy);
  scanf("%lf%lf%lf%lf", &mirror.x, &mirror.y, &mirror.xx, &mirror.yy);
  c = Jiao(x, y, wall);
  d = Jiao(x, y, mirror);
  if ((c == 0 || c == 3) && (d == 0 || d >= 3)) {
    printf("YES\n");
    return 0;
  }
  yy = DC(y, mirror);
  f = 1;
  c = Jiao(x, yy, mirror);
  f = 0;
  d = Jiao(ww, y, wall);
  e = Jiao(x, ww, wall);
  if ((c == 1) && (d == 0 || d == 3) && (e == 0 || e == 3)) {
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
