#include <bits/stdc++.h>
using namespace std;
double yxabs(double a) {
  if (a < 0) a = -a;
  return a;
}
struct T {
  double x, y;
  void init() { scanf("%lf%lf", &x, &y); }
  T(double X = 0, double Y = 0) {
    x = X;
    y = Y;
  }
  friend T operator-(const T &A, const T &B) { return T(A.x - B.x, A.y - B.y); }
  friend T operator+(const T &A, const T &B) { return T(A.x + B.x, A.y + B.y); }
  friend double operator*(const T &a, const T &b) {
    double t = a.x * b.y - b.x * a.y;
    if (yxabs(t) < 1E-7) return 0;
    return t;
  }
  friend T operator*(const T &a, const double x) { return T(a.x * x, a.y * x); }
} A, B, W1, W2, T1, T2;
bool Ck(const T &P1, const T &P2, const T &L1, const T &L2) {
  if (max(P1.x, P2.x) < min(L1.x, L2.x) || max(P1.y, P2.y) < min(L1.y, L2.y))
    return true;
  return ((L2 - L1) * (P1 - L1)) * ((L2 - L1) * (P2 - L1)) > 0;
}
T M(const T &P1, const T &P2, const T &P3) {
  double A1 = P3.x - P2.x, B1 = P3.y - P2.y,
         C1 = -(P3.x - P2.x) * P1.x - P1.y * (P3.y - P2.y);
  double A2 = -(P3.y - P2.y), B2 = P3.x - P2.x,
         C2 = (P3 - P2).x * (P1 - P2).y - (P3 - P2).y * (P1 - P2).x -
              (P3 - P2).x * P2.y + (P3.y - P2.y) * P2.x;
  return T((-C1 * B2 + C2 * B1) / (B2 * A1 - A2 * B1),
           (C2 * A1 - C1 * A2) / (B1 * A2 - B2 * A1));
}
int main() {
  A.init();
  B.init();
  W1.init();
  W2.init();
  T1.init();
  T2.init();
  if (Ck(A, B, W1, W2) || Ck(W1, W2, A, B)) {
    if (Ck(A, B, T1, T2) || Ck(T1, T2, A, B) ||
        (yxabs((T2 - T1) * (A - T1)) < 1E-7 &&
         yxabs((T2 - T1) * (B - T1)) < 1E-7))
      printf("YES\n");
    else
      printf("NO\n");
    return 0;
  }
  if (Ck(A, B, T1, T2)) {
    T M1 = M(A, T1, T2);
    if (Ck(B, M1, T1, T2) || Ck(T1, T2, B, M1)) {
      printf("NO\n");
      return 0;
    }
    T C = T1 + (T2 - T1) *
                   (yxabs((M1 - B) * (T1 - B)) /
                    (yxabs((M1 - B) * (T1 - B)) + yxabs((M1 - B) * (T2 - B))));
    if (Ck(C, B, W1, W2) || Ck(W1, W2, C, B))
      if (Ck(C, A, W1, W2) || Ck(W1, W2, C, A)) {
        printf("YES\n");
        return 0;
      }
  }
  printf("NO\n");
  return 0;
}
