#include <bits/stdc++.h>
using namespace std;
struct rec {
  double x, y;
} v, p, w1, w2, m1, m2, p_, m;
double eps = 1e-10;
inline rec operator+(rec a, rec b) { return (rec){a.x + b.x, a.y + b.y}; }
inline rec operator-(rec a, rec b) { return (rec){a.x - b.x, a.y - b.y}; }
double mul(rec a, rec b, rec c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
double dist(rec a, rec b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
bool line(rec a, rec b, rec c) {
  return fabs(dist(a, c) + dist(b, c) - dist(a, b)) < eps;
}
bool cross(rec a, rec b, rec c, rec d, int k) {
  if (!k && line(a, b, c) && line(a, b, d)) return 0;
  if (line(a, b, c) || line(a, b, d) || line(c, d, a) || line(c, d, b))
    return 1;
  return mul(a, c, b) * mul(a, b, d) > eps && mul(c, a, d) * mul(c, d, b) > eps;
}
rec point(rec a, rec b, rec c, rec d) {
  double t1 = mul(a, c, b), t2 = mul(a, b, d);
  return (rec){(c.x * t2 + d.x * t1) / (t1 + t2),
               (c.y * t2 + d.y * t1) / (t1 + t2)};
}
rec turn(rec a, double th) {
  return (rec){a.x * cos(th) - a.y * sin(th), a.x * sin(th) + a.y * cos(th)};
}
rec oppo(rec c, rec a, rec b) {
  rec h = point(a, b, c, c + turn(b - a, acos(-1.0) / 2));
  return h + (h - c);
}
int main() {
  cin >> v.x >> v.y >> p.x >> p.y >> w1.x >> w1.y >> w2.x >> w2.y >> m1.x >>
      m1.y >> m2.x >> m2.y;
  if (!cross(v, p, w1, w2, 1) && !cross(v, p, m1, m2, 0)) {
    puts("YES");
    return 0;
  }
  p_ = oppo(p, m1, m2);
  if (cross(v, p_, m1, m2, 0)) {
    m = point(v, p_, m1, m2);
    if (!cross(p, m, w1, w2, 1) && !cross(m, v, w1, w2, 1)) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
}
