#include <bits/stdc++.h>
using namespace std;
inline int get() {
  char c;
  bool f = 0;
  while (!isdigit(c = getchar())) f |= c == '-';
  int v = c - 48;
  while (isdigit(c = getchar())) v = v * 10 + c - 48;
  return f ? -v : v;
}
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  void re() {
    x = get();
    y = get();
  }
} p1, p2, p3, w1, w2, m1, m2;
Point operator+(Point a, Point b) { return Point(a.x + b.x, a.y + b.y); }
Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
Point operator*(Point a, double t) { return Point(a.x * t, a.y * t); }
double cha(Point a, Point b) { return a.x * b.y - a.y * b.x; }
int sgn(double t) {
  if (fabs(t) < 1e-6) return 0;
  return t > 0 ? 1 : -1;
}
bool jiao(Point a, Point b, Point c, Point d) {
  int t1 = sgn(cha(c - b, a - b)), t2 = sgn(cha(d - b, a - b)),
      t3 = sgn(cha(a - c, d - c)), t4 = sgn(cha(b - c, d - c));
  if (t1 * t2 == 0 && t3 * t4 == 0)
    return (a.x <= c.x && c.x <= b.x) || (a.x <= d.x && d.x <= b.x) ||
           (c.x <= a.x && a.x <= d.x) || (c.x <= b.x && b.x <= d.x);
  return t1 * t2 <= 0 && t3 * t4 <= 0;
}
int main() {
  p1.re();
  p2.re();
  w1.re();
  w2.re();
  m1.re();
  m2.re();
  if (!jiao(p1, p2, w1, w2) &&
      (!jiao(p1, p2, m1, m2) || sgn(cha(p2 - p1, m2 - m1)) == 0))
    return puts("YES"), 0;
  if (jiao(p1, p2, m1, m2) && sgn(cha(p2 - p1, m2 - m1)) != 0)
    return puts("NO"), 0;
  if (sgn(cha(p1 - m1, m2 - m1)) != sgn(cha(p2 - m1, m2 - m1)))
    return puts("NO"), 0;
  Point v(m2.y - m1.y, m1.x - m2.x), vx = m2 - m1;
  v = v * (1.0 / sqrt(v.x * v.x + v.y * v.y));
  v = v * (cha(p1 - m1, vx) / sqrt(vx.x * vx.x + vx.y * vx.y));
  Point p4 = p1 - v - v;
  v = p4 - p2;
  if (sgn(cha(v, vx) == 0)) return puts("NO"), 0;
  p3 = p2 + v * (cha(vx, p2 - m2) / cha(v, vx));
  if (((m1.x <= p3.x && p3.x <= m2.x) || (m2.x <= p3.x && p3.x <= m1.x)) &&
      !jiao(p1, p3, w1, w2) && !jiao(p2, p3, w1, w2))
    return puts("YES"), 0;
  puts("NO");
  return 0;
}
