#include <bits/stdc++.h>
struct Point {
  double x, y;
};
struct Seg {
  Point s, e;
};
struct Line {
  double a, b, c;
};
Point V, P;
Seg W, M;
int parallel(Line l1, Line l2) {
  return (fabs(l1.a - l2.a) < 1e-8 ? 0 : ((l1.a - l2.a) > 0 ? 1 : -1)) == 0 &&
         (fabs(l1.b - l2.b) < 1e-8 ? 0 : ((l1.b - l2.b) > 0 ? 1 : -1)) == 0;
}
int same_line(Line l1, Line l2) {
  return parallel(l1, l2) &&
         (fabs(l1.c - l2.c) < 1e-8 ? 0 : ((l1.c - l2.c) > 0 ? 1 : -1)) == 0;
}
double cross(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
Point mirror(Point p, Line l) {
  Point t;
  t.x = ((l.b * l.b - l.a * l.a) * p.x - 2.0 * l.a * l.b * p.y -
         2.0 * l.a * l.c) /
        (l.a * l.a + l.b * l.b);
  t.y = ((l.a * l.a - l.b * l.b) * p.y - 2.0 * l.a * l.b * p.x -
         2.0 * l.b * l.c) /
        (l.a * l.a + l.b * l.b);
  return t;
}
void make_line(Point p1, Point p2, Line &l) {
  if ((fabs(p1.x - p2.x) < 1e-8 ? 0 : ((p1.x - p2.x) > 0 ? 1 : -1)) == 0)
    l.a = 1, l.b = 0, l.c = -p1.x;
  else
    l.b = 1, l.a = -(p1.y - p2.y) / (p1.x - p2.x),
    l.c = -(l.a * p1.x) - (l.b * p1.y);
}
Point intersect(Line l1, Line l2) {
  Point p;
  p.x = (l2.b * l1.c - l1.b * l2.c) / (l2.a * l1.b - l1.a * l2.b);
  if ((fabs(l1.b) < 1e-8 ? 0 : ((l1.b) > 0 ? 1 : -1)) != 0)
    p.y = -(l1.a * p.x + l1.c) / l1.b;
  else
    p.y = -(l2.a * p.x + l2.c) / l2.b;
  return p;
}
int xyCmp(double p, double mini, double maxi) {
  return (fabs(p - mini) < 1e-8 ? 0 : ((p - mini) > 0 ? 1 : -1)) *
         (fabs(p - maxi) < 1e-8 ? 0 : ((p - maxi) > 0 ? 1 : -1));
}
int betweenCmp(Point a, Point b, Point c) {
  if (fabs(b.x - c.x) > fabs(b.y - c.y))
    return xyCmp(a.x, ((b.x) < (c.x) ? (b.x) : (c.x)),
                 ((b.x) > (c.x) ? (b.x) : (c.x)));
  else
    return xyCmp(a.y, ((b.y) < (c.y) ? (b.y) : (c.y)),
                 ((b.y) > (c.y) ? (b.y) : (c.y)));
}
int segcross(Point a, Point b, Point c, Point d) {
  double s1, s2, s3, s4;
  int d1, d2, d3, d4;
  d1 =
      (fabs(s1 = cross(a, b, c)) < 1e-8 ? 0
                                        : ((s1 = cross(a, b, c)) > 0 ? 1 : -1));
  d2 =
      (fabs(s2 = cross(a, b, d)) < 1e-8 ? 0
                                        : ((s2 = cross(a, b, d)) > 0 ? 1 : -1));
  d3 =
      (fabs(s3 = cross(c, d, a)) < 1e-8 ? 0
                                        : ((s3 = cross(c, d, a)) > 0 ? 1 : -1));
  d4 =
      (fabs(s4 = cross(c, d, b)) < 1e-8 ? 0
                                        : ((s4 = cross(c, d, b)) > 0 ? 1 : -1));
  if (d1 * d2 < 0 && d3 * d4 < 0) return 1;
  if (d1 == 0 && betweenCmp(c, a, b) <= 0 ||
      d2 == 0 && betweenCmp(d, a, b) <= 0 ||
      d3 == 0 && betweenCmp(a, c, d) <= 0 ||
      d4 == 0 && betweenCmp(b, c, d) <= 0) {
    return 2;
  }
  return 0;
}
int main() {
  int i;
  scanf("%lf%lf", &V.x, &V.y);
  scanf("%lf%lf", &P.x, &P.y);
  scanf("%lf%lf%lf%lf", &W.s.x, &W.s.y, &W.e.x, &W.e.y);
  scanf("%lf%lf%lf%lf", &M.s.x, &M.s.y, &M.e.x, &M.e.y);
  Line lm, ll, vp, lw;
  make_line(M.s, M.e, lm);
  make_line(W.s, W.e, lw);
  make_line(V, P, vp);
  if (same_line(vp, lm)) {
    if (segcross(P, V, W.s, W.e))
      printf("NO\n");
    else
      printf("YES\n");
    return 0;
  }
  if (!segcross(P, V, W.s, W.e) && !segcross(P, V, M.s, M.e)) {
    printf("YES\n");
    return 0;
  }
  if (segcross(P, V, M.s, M.e)) {
    printf("NO\n");
    return 0;
  }
  if ((fabs((lm.a * V.x + lm.b * V.y + lm.c) *
            (lm.a * P.x + lm.b * P.y + lm.c)) < 1e-8
           ? 0
           : (((lm.a * V.x + lm.b * V.y + lm.c) *
               (lm.a * P.x + lm.b * P.y + lm.c)) > 0
                  ? 1
                  : -1)) <= 0 &&
      segcross(P, V, W.s, W.e)) {
    printf("NO\n");
    return 0;
  }
  Point r, I;
  r = mirror(P, lm);
  make_line(V, r, ll);
  I = intersect(ll, lm);
  if (betweenCmp(I, M.s, M.e) <= 0) {
    if (!segcross(V, I, W.s, W.e) && !segcross(P, I, W.s, W.e))
      printf("YES\n");
    else
      printf("NO\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
