#include <bits/stdc++.h>
using namespace std;
struct pt {
  double x, y;
  pt(double X = 0, double Y = 0) {
    x = X;
    y = Y;
  }
  pt operator+(const pt &B) { return pt(x + B.x, y + B.y); }
  pt operator-(const pt &B) { return pt(x - B.x, y - B.y); }
  double operator*(const pt &B) { return x * B.y - B.x * y; }
  pt operator*(const double &c) { return pt(x * c, y * c); }
} A, B, C, D;
struct seg {
  pt s, e, v;
  seg() {}
  seg(pt S, pt E) {
    s = S;
    e = E;
    v = E - S;
  }
} mir, wal;
pt crs(seg A, seg B) {
  double S1 = (B.s - A.s) * A.v, S2 = A.v * B.v;
  return B.s + (B.v * (S1 / S2));
}
bool onit(pt C, seg A) {
  if ((C.x < min(A.s.x, A.e.x) - 1e-8) || (C.x > max(A.s.x, A.e.x) + 1e-8))
    return 0;
  if ((C.y < min(A.s.y, A.e.y) - 1e-8) || (C.y > max(A.s.y, A.e.y) + 1e-8))
    return 0;
  return 1;
}
bool cross(seg A, seg B, int md) {
  if (fabs(A.v * B.v) < 1e-8) {
    if (md == 0) return 0;
    if (onit(A.s, B) || onit(A.e, B) || onit(B.s, A) || onit(B.e, A)) return 1;
    return 0;
  }
  pt C = crs(A, B);
  return onit(C, A) && onit(C, B);
}
bool case_1() {
  if (cross(seg(A, B), mir, 0)) return 0;
  if (cross(seg(A, B), wal, 1)) return 0;
  return 1;
}
int sgn(double x) {
  if (x < -1e-8) return -1;
  if (x > 1e-8) return 1;
  return 0;
}
bool case_2() {
  int ca = sgn((A - mir.s) * mir.v), cb = sgn((B - mir.s) * mir.v);
  if (!((ca < 0 && cb < 0) || (ca > 0 && cb > 0))) return 0;
  if (!cross(seg(A, D), mir, 0)) return 0;
  C = crs(seg(A, D), mir);
  if (cross(seg(A, C), wal, 1)) return 0;
  if (cross(seg(C, B), wal, 1)) return 0;
  return 1;
}
int main() {
  scanf("%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y);
  scanf("%lf%lf%lf%lf", &wal.s.x, &wal.s.y, &wal.e.x, &wal.e.y);
  wal.v = wal.e - wal.s;
  scanf("%lf%lf%lf%lf", &mir.s.x, &mir.s.y, &mir.e.x, &mir.e.y);
  mir.v = mir.e - mir.s;
  C = B + pt(-mir.v.y, mir.v.x);
  C = crs(seg(B, C), mir);
  D = C + (C - B);
  if (case_1() || case_2())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
