#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1024;
const double eps = 1e-9;
int sign(double k) {
  if (fabs(k) < eps) return 0;
  return k > 0 ? 1 : -1;
}
inline double sqr(double k) { return k * k; }
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
  void get() { scanf("%lf %lf", &x, &y); }
  void out() { cout << x << ' ' << y << endl; }
};
struct Seg {
  Point a, b;
  Seg() {}
  Seg(Point _a, Point _b) : a(_a), b(_b) {}
  double len() { return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y)); }
};
inline double cross(double x1, double y1, double x2, double y2) {
  return x1 * y2 - x2 * y1;
}
double cross(Point a, Point b, Point c) {
  return cross(b.x - a.x, b.y - a.y, c.x - a.x, c.y - a.y);
}
inline double dot(double x1, double y1, double x2, double y2) {
  return x1 * x2 + y1 * y2;
}
double dot(Point a, Point b, Point c) {
  return dot(b.x - a.x, b.y - a.y, c.x - a.x, c.y - a.y);
}
inline int pinl(Point p, Seg line) {
  double s1 = cross(line.a, line.b, p);
  double s2 = dot(p, line.a, line.b);
  return sign(s1) == 0 && sign(s2) <= 0;
}
int inter1(Seg l1, Seg l2) {
  int f1, f2;
  f1 = sign(cross(l1.a, l1.b, l2.a)) * sign(cross(l1.a, l1.b, l2.b));
  f2 = sign(cross(l2.a, l2.b, l1.a)) * sign(cross(l2.a, l2.b, l1.b));
  return f1 == -1 && f2 == -1;
}
int inter2(Seg l1, Seg l2) {
  int f = inter1(l1, l2);
  if (f) return 1;
  if (pinl(l1.a, l2) || pinl(l1.b, l2) || pinl(l2.a, l1) || pinl(l2.b, l1))
    f = 1;
  return f;
}
Point psidel(Point p, Seg line) {
  double len = line.len();
  double x, y, s, d;
  x = line.b.x - line.a.x;
  y = line.b.y - line.a.y;
  s = cross(line.a, p, line.b);
  d = s / len;
  Point tp;
  tp.x = p.x + (-y) / len * d * 2;
  tp.y = p.y + x / len * d * 2;
  return tp;
}
bool SecSeg_Intersect(Seg A, Seg B, Point &p) {
  double s1 = cross(A.a, B.a, A.b);
  double s2 = cross(A.a, A.b, B.b);
  p.x = (s1 * B.b.x + s2 * B.a.x) / (s1 + s2);
  p.y = (s1 * B.b.y + s2 * B.a.y) / (s1 + s2);
  return 1;
}
int main() {
  Point p1, p2, p11, p22;
  Seg l1, l2;
  int flag;
  while (cin >> p1.x >> p1.y) {
    p2.get();
    l1.a.get();
    l1.b.get();
    l2.a.get();
    l2.b.get();
    flag = 0;
    Seg l3 = Seg(p1, p2);
    if (!inter2(l3, l1) && !inter1(l3, l2) &&
        (pinl(l2.a, l3) + pinl(l2.b, l3) != 1)) {
      flag = 1;
    } else {
      p22 = psidel(p2, l2);
      p11 = psidel(p1, l2);
      Seg l4 = Seg(p1, p22);
      Seg l6;
      double s1 = cross(l2.a, l2.b, p1), s2 = cross(l2.a, l2.b, p2);
      if (sign(s1) * sign(s2) > 0 && inter2(l4, l2)) {
        Point tp;
        SecSeg_Intersect(l4, l2, tp);
        if (!inter2(l1, Seg(p1, tp)) && !inter2(l1, Seg(p2, tp))) {
          flag = 1;
        }
      }
    }
    if (flag) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
