#include <bits/stdc++.h>
using namespace std;
int fcmp(double x) { return fabs(x) < 1e-10 ? 0 : (x > 0 ? 1 : -1); }
bool fequal(double a, double b) { return fabs(a - b) < 1e-10; }
struct point {
  double x, y;
  point(double x = 0, double y = 0) : x(x), y(y) {}
};
double cp(point a, point b) { return a.x * b.y - a.y * b.x; }
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
point operator*(point a, double b) { return point(a.x * b, a.y * b); }
bool operator==(point a, point b) {
  return (fequal(a.x, b.x) && fequal(a.y, b.y));
}
struct line {
  point p1, p2;
  double a, b, c;
  line() {}
  line(point px, point py) {
    a = py.y - px.y;
    b = px.x - py.x;
    c = -a * px.x - b * px.y;
    p1 = px, p2 = py;
  }
};
point sym_point(point p, line l) {
  point p2;
  double d;
  d = l.a * l.a + l.b * l.b;
  p2.x = (l.b * l.b * p.x - l.a * l.a * p.x - 2 * l.a * l.b * p.y -
          2 * l.a * l.c) /
         d;
  p2.y = (l.a * l.a * p.y - l.b * l.b * p.y - 2 * l.a * l.b * p.x -
          2 * l.b * l.c) /
         d;
  return p2;
}
point p1, p2;
line mir, wal;
int seg_prop_intersect(point a1, point a2, point b1, point b2) {
  double c1, c2, c3, c4;
  c1 = cp(a2 - a1, b1 - a1);
  c2 = cp(a2 - a1, b2 - a1);
  c3 = cp(b2 - b1, a1 - b1);
  c4 = cp(b2 - b1, a2 - b1);
  return fcmp(c1) * fcmp(c2) < 0 && fcmp(c3) * fcmp(c4) < 0;
}
int seg_colinear(point a1, point a2, point b1, point b2) {
  if (fcmp(cp(a1 - b1, a1 - b2)) == 0 && fcmp(cp(a2 - b1, a2 - b2)) == 0)
    return 1;
  else
    return 0;
}
int seg_inprop_intersect(point a1, point a2, point b1, point b2) {
  double c1, c2, c3, c4;
  if (seg_colinear(a1, a2, b1, b2)) {
    if (fcmp(max(a1.x, a2.x) - min(b1.x, b2.x)) < 0) return 0;
    if (fcmp(max(b1.x, b2.x) - min(a1.x, a2.x)) < 0) return 0;
    return 1;
  }
  c1 = cp(a2 - a1, b1 - a1);
  c2 = cp(a2 - a1, b2 - a1);
  c3 = cp(b2 - b1, a1 - b1);
  c4 = cp(b2 - b1, a2 - b1);
  return fcmp(c1) * fcmp(c2) <= 0 && fcmp(c3) * fcmp(c4) <= 0;
}
int point_on_seg(point p, point a, point b) {
  if (p == a) return 1;
  if (p == b) return 1;
  if (fequal(cp(p - a, p - b), 0)) {
    if ((p.x > a.x && p.y > a.y && p.x < b.x && p.y < b.y) ||
        (p.x > b.x && p.y > b.y && p.x < a.x && p.y < a.y))
      return 1;
    return 0;
  }
  return 0;
}
int seg_intersect_term(point a1, point a2, point b1, point b2) {
  if (seg_colinear(a1, a2, b1, b2)) {
    if (a1 == b1 && !point_on_seg(a1, b1, b2)) return 1;
    if (a2 == b1 && !point_on_seg(a2, b1, b2)) return 1;
    if (a1 == b2 && !point_on_seg(a1, b1, b2)) return 1;
    if (a2 == b2 && !point_on_seg(a2, b1, b2)) return 1;
    return 0;
  }
  if (seg_inprop_intersect(a1, a2, b1, b2)) return 1;
  return 0;
}
point intersect_point(point p, point v, point q, point w) {
  point u = p - q;
  double t = cp(w, u) / cp(v, w);
  return p + v * t;
}
int judge() {
  point p3, p4;
  if (seg_prop_intersect(p1, p2, mir.p1, mir.p2)) return 0;
  if (seg_colinear(p1, p2, mir.p1, mir.p2) &&
      seg_inprop_intersect(p1, p2, wal.p1, wal.p2))
    return 0;
  if (!seg_intersect_term(p1, p2, mir.p1, mir.p2) &&
      !seg_inprop_intersect(p1, p2, wal.p1, wal.p2))
    return 1;
  if (fcmp(cp(p1 - mir.p1, mir.p2 - mir.p1) *
           cp(p2 - mir.p1, mir.p2 - mir.p1)) < 0 &&
      seg_inprop_intersect(p1, p2, wal.p1, wal.p2))
    return 0;
  p3 = sym_point(p1, mir);
  if (seg_intersect_term(p3, p2, mir.p1, mir.p2) &&
      !seg_inprop_intersect(p3, p2, wal.p1, wal.p2)) {
    p4 = intersect_point(p3, p2 - p3, mir.p1, mir.p2 - mir.p1);
    if (!seg_inprop_intersect(p1, p4, wal.p1, wal.p2) &&
        !seg_inprop_intersect(p2, p4, wal.p1, wal.p2))
      return 1;
  }
  return 0;
}
int main() {
  scanf("%lf%lf", &p1.x, &p1.y);
  scanf("%lf%lf", &p2.x, &p2.y);
  scanf("%lf%lf%lf%lf", &wal.p1.x, &wal.p1.y, &wal.p2.x, &wal.p2.y);
  scanf("%lf%lf%lf%lf", &mir.p1.x, &mir.p1.y, &mir.p2.x, &mir.p2.y);
  mir = line(mir.p1, mir.p2);
  if (judge())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
