#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int get() {
  int f = 0, v = 0;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') break;
  if (ch == '-')
    f = 1;
  else
    v = ch - 48;
  while (isdigit(ch = getchar())) v = v * 10 + ch - 48;
  if (f == 1)
    return -v;
  else
    return v;
}
struct Tpoint {
  double x, y;
  void getpoint() { x = get(), y = get(); }
  Tpoint() {}
  Tpoint(double _x, double _y) { x = _x, y = _y; }
} A, B, m1, m2, w1, w2;
Tpoint operator-(Tpoint a, Tpoint b) { return Tpoint(a.x - b.x, a.y - b.y); }
Tpoint operator+(Tpoint a, Tpoint b) { return Tpoint(a.x + b.x, a.y + b.y); }
Tpoint operator/(Tpoint a, double b) {
  a.x /= b, a.y /= b;
  return a;
}
Tpoint operator*(Tpoint a, double b) {
  a.x *= b, a.y *= b;
  return a;
}
double operator*(Tpoint a, Tpoint b) { return a.x * b.y - a.y * b.x; }
int sig(double x) {
  if (fabs(x) <= eps) return 0;
  if (x > eps)
    return 1;
  else
    return -1;
}
Tpoint getoppo(Tpoint C, Tpoint A, Tpoint B) {
  double a = A.y - B.y, b = B.x - A.x, c = A * B;
  double t = (a * C.x + b * C.y + c) / (a * a + b * b);
  return Tpoint(C.x - 2 * a * t, C.y - 2 * b * t);
}
bool cross(Tpoint a, Tpoint b, Tpoint c, Tpoint d, bool f) {
  int t1 = sig((a - d) * (c - d)), t2 = sig((c - d) * (b - d));
  int t3 = sig((c - b) * (a - b)), t4 = sig((a - b) * (d - b));
  if (t1 * t2 < 0 || t3 * t4 < 0) return 0;
  if (t1 == 0 && t2 == 0 && t3 == 0 && t4 == 0) {
    if (f) return 0;
    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 (sig(min(x2, x4) - max(x1, x3)) >= 0 &&
        sig(min(y2, y4) - max(y1, y3)) >= 0)
      return 1;
    else
      return 0;
  }
  return 1;
}
Tpoint getintersection(Tpoint A, Tpoint B, Tpoint C, Tpoint D) {
  double ta = (B - C) * (A - C), tb = (D - B) * (A - B);
  Tpoint res;
  res = (D - C) / (ta + tb) * ta + C;
  return res;
}
int main() {
  A.getpoint(), B.getpoint();
  w1.getpoint(), w2.getpoint();
  m1.getpoint(), m2.getpoint();
  if (cross(A, B, w1, w2, 0)) {
    Tpoint C = getoppo(A, m1, m2), D;
    if ((sig(C.x - A.x) != 0 || sig(C.y - A.y) != 0) &&
        cross(C, B, m1, m2, 1)) {
      D = getintersection(C, B, m1, m2);
      if (cross(D, A, w1, w2, 0) || cross(D, B, w1, w2, 1))
        puts("NO");
      else
        puts("YES");
    } else
      puts("NO");
  } else {
    if (cross(A, B, m1, m2, 1))
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
