#include <bits/stdc++.h>
const double eps = 1e-8;
double Xv, Yv, Xp, Yp, Xw1, Yw1, Xw2, Yw2, Xm1, Ym1, Xm2, Ym2, Xc, Yc, Xg, Yg;
double Am, Bm, Cm, Av, Bv, Cv;
int Xot(double X1, double Y1, double X2, double Y2) {
  double V = X1 * Y2 - X2 * Y1;
  if (fabs(V) < eps) return 0;
  if (V < 0) return -1;
  if (V > 0) return 1;
}
double dis(double X1, double Y1, double X2, double Y2) {
  return sqrt((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2));
}
bool On(double X1, double Y1, double X2, double Y2, double X3, double Y3) {
  double l1 = dis(X1, Y1, X2, Y2);
  double l2 = dis(X1, Y1, X3, Y3);
  double l3 = dis(X2, Y2, X3, Y3);
  if (fabs(l1 + l2 - l3) < eps) return 1;
  return 0;
}
int Cross(double X1, double Y1, double X2, double Y2, double X3, double Y3,
          double X4, double Y4) {
  int v = Xot(X2 - X1, Y2 - Y1, X4 - X3, Y4 - Y3);
  if (v == 0) {
    if (On(X1, Y1, X3, Y3, X4, Y4)) return 2;
    if (On(X2, Y2, X3, Y3, X4, Y4)) return 2;
    if (On(X3, Y3, X1, Y1, X2, Y2)) return 2;
    if (On(X4, Y4, X1, Y1, X2, Y2)) return 2;
    return 1;
  }
  int V1 = Xot(X3 - X1, Y3 - Y1, X2 - X1, Y2 - Y1) *
           Xot(X4 - X1, Y4 - Y1, X2 - X1, Y2 - Y1);
  int V2 = Xot(X1 - X3, Y1 - Y3, X4 - X3, Y4 - Y3) *
           Xot(X2 - X3, Y2 - Y3, X4 - X3, Y4 - Y3);
  if (V1 > 0 || V2 > 0) return 1;
  if (V1 < 0 && V2 < 0) return -1;
  return 0;
}
void Node() {
  double p;
  if (fabs(Am) < eps) {
    Xc = Xv, Yc = Ym1;
    return;
  }
  if (fabs(Bm) < eps) {
    Xc = Xm1, Yc = Yv;
    return;
  }
  Av = -Bm, Bv = Am, Cv = Xv * Av + Yv * Bv;
  p = Am / Av;
  Av *= p, Bv *= p, Cv *= p;
  if (fabs(Bv - Bm) > eps) {
    Yc = (Cv - Cm) / (Bv - Bm);
    Xc = (Cv - Bv * Yc) / Av;
  } else {
    Xc = (Cv - Cm) / (Av - Am);
    Yc = (Cv - Av * Xc) / Bv;
  }
}
void Get() {
  double p;
  Av = Yg - Yp, Bv = Xp - Xg, Cv = Xg * Av + Yg * Bv;
  if (fabs(Am) < eps) {
    Yc = Ym1;
    Xc = (Cv - Bv * Yc) / Av;
    return;
  }
  if (fabs(Bm) < eps) {
    Xc = Xm1;
    Yc = (Cv - Av * Xc) / Bv;
    return;
  }
  if (fabs(Av) < eps) {
    Yc = Yg;
    Xc = (Cm - Bm * Yc) / Am;
    return;
  }
  if (fabs(Bv) < eps) {
    Xc = Xg;
    Yc = (Cm - Am * Xc) / Bm;
    return;
  }
  p = Am / Av;
  Av *= p, Bv *= p, Cv *= p;
  if (fabs(Bv - Bm) > eps) {
    Yc = (Cv - Cm) / (Bv - Bm);
    Xc = (Cv - Bv * Yc) / Av;
  } else {
    Xc = (Cv - Cm) / (Av - Am);
    Yc = (Cv - Av * Xc) / Bv;
  }
}
int main() {
  scanf("%lf%lf", &Xv, &Yv);
  scanf("%lf%lf", &Xp, &Yp);
  scanf("%lf%lf%lf%lf", &Xw1, &Yw1, &Xw2, &Yw2);
  scanf("%lf%lf%lf%lf", &Xm1, &Ym1, &Xm2, &Ym2);
  Am = Ym1 - Ym2, Bm = Xm2 - Xm1, Cm = Xm1 * Am + Ym1 * Bm;
  if (Cross(Xv, Yv, Xp, Yp, Xw1, Yw1, Xw2, Yw2) == 1 &&
      Cross(Xv, Yv, Xp, Yp, Xm1, Ym1, Xm2, Ym2) > 0) {
    printf("YES\n");
    return 0;
  }
  Node(), Xg = 2 * Xc - Xv, Yg = 2 * Yc - Yv;
  if (Cross(Xg, Yg, Xp, Yp, Xm1, Ym1, Xm2, Ym2) <= 0) {
    Get();
    if (Cross(Xv, Yv, Xc, Yc, Xw1, Yw1, Xw2, Yw2) == 1 &&
        Cross(Xc, Yc, Xp, Yp, Xw1, Yw1, Xw2, Yw2) == 1) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
