#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y, z;
  point() { x = 0, y = 0, z = 0; }
  point(double _x, double _y, double _z) { x = _x, y = _y, z = _z; }
  double len();
};
int tt;
point operator*(const point &a, double p) {
  return point(a.x * p, a.y * p, a.z * p);
}
point operator*(double p, const point &a) {
  return point(a.x * p, a.y * p, a.z * p);
}
point operator+(const point &a, const point &b) {
  return point(a.x + b.x, a.y + b.y, a.z + b.z);
}
point operator-(const point &a, const point &b) {
  return point(a.x - b.x, a.y - b.y, a.z - b.z);
}
point operator+=(point &a, const point &b) {
  a = a + b;
  return a;
}
point operator-=(point &a, const point &b) {
  a = a - b;
  return a;
}
point operator*=(point &a, int p) {
  a = a * p;
  return a;
}
double point::len() { return sqrt(x * x + y * y + z * z); }
double dist(const point &a, const point &b) { return (a - b).len(); }
point cross(const point &a, const point &b) {
  return point(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z,
               a.x * b.y - a.y * b.x);
}
double dot(const point &a, const point &b) {
  return a.x * b.x + a.y * b.y + a.z * b.z;
}
int sign(double x) {
  if (x > 1e-9) return 1;
  if (x < -1e-9) return -1;
  return 0;
}
bool segcross(point a, point b, point c, point d, int mode) {
  int t1 = sign(cross(b - a, c - a).z);
  int t2 = sign(cross(b - a, d - a).z);
  if (t1 * t2 == 1) return false;
  int t3 = sign(cross(d - c, a - c).z);
  int t4 = sign(cross(d - c, b - c).z);
  if (t3 * t4 == 1) return false;
  if (t1 == 0 && t2 == 0 && t3 == 0 && t4 == 0) {
    if (mode == 1) return false;
    double x1 = min(a.x, b.x), x2 = max(a.x, b.x);
    double y1 = min(a.y, b.y), y2 = max(a.y, b.y);
    double x3 = min(c.x, d.x), x4 = max(c.x, d.x);
    double y3 = min(c.y, d.y), y4 = max(c.y, d.y);
    if (sign(min(x2, x4) - max(x1, x3)) >= 0 &&
        sign(min(y2, y4) - max(y1, y3)) >= 0)
      return true;
    else
      return false;
  }
  return true;
}
point reflect(point f1, point f2, point p) {
  if (dist(f1, f2) < 1e-9) return 2 * f1 - p;
  point f3 =
      dot(f2 - f1, p - f1) / dist(f1, f2) / dist(f1, f2) * (f2 - f1) + f1;
  return 2 * f3 - p;
}
point p1, p2;
point w1, w2;
point m1, m2;
point getinter2d(point a, point b, point c, point d) {
  point p1 = b - a, p2 = d - c;
  double f1 = cross(a, b).z, f2 = cross(c, d).z;
  double f3 = cross(p1, p2).z;
  return point((f2 * p1.x - f1 * p2.x) / f3, (f2 * p1.y - f1 * p2.y) / f3, 0);
}
int main() {
  scanf("%lf%lf", &p1.x, &p1.y);
  scanf("%lf%lf", &p2.x, &p2.y);
  scanf("%lf%lf%lf%lf", &w1.x, &w1.y, &w2.x, &w2.y);
  scanf("%lf%lf%lf%lf", &m1.x, &m1.y, &m2.x, &m2.y);
  if (segcross(p1, p2, w1, w2, 0)) {
    point q = reflect(m1, m2, p1);
    if (segcross(p2, q, m1, m2, 1)) {
      point t = getinter2d(q, p2, m1, m2);
      if (segcross(p1, t, w1, w2, 0) || segcross(t, p2, w1, w2, 0))
        printf("NO\n");
      else
        printf("YES\n");
    } else
      printf("NO\n");
  } else {
    if (segcross(p1, p2, m1, m2, 1))
      printf("NO\n");
    else
      printf("YES\n");
  }
}
