#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y;
  point() : x(0), y(0) {}
  point(double x, double y) : x(x), y(y) {}
  double cross(point const& p) const { return x * p.y - y * p.x; }
  double dot(point const& p) const { return x * p.x + y * p.y; }
  point operator-(point const& p) const { return point(x - p.x, y - p.y); }
  point operator+(point const& p) const { return point(x + p.x, y + p.y); }
  point operator*(double k) const { return point(k * x, k * y); }
};
struct line {
  point p1, p2;
  line() {}
  line(point p1, point p2) : p1(p1), p2(p2) {}
};
double sarea(point p1, point p2, point p3) {
  double x_1 = p1.x;
  double x_2 = p2.x;
  double x_3 = p3.x;
  double y_1 = p1.y;
  double y_2 = p2.y;
  double y_3 = p3.y;
  double ux = x_2 - x_1;
  double uy = y_2 - y_1;
  double vx = x_3 - x_1;
  double vy = y_3 - y_1;
  return ux * vy - uy * vx;
}
const double eps = 1e-8;
bool intersect(line l1, line l2) {
  double a1 = sarea(l1.p1, l2.p1, l2.p2);
  double a2 = sarea(l1.p2, l2.p2, l2.p1);
  double a3 = sarea(l2.p1, l1.p1, l1.p2);
  double a4 = sarea(l2.p2, l1.p2, l1.p1);
  if (::std::abs(a1) < eps && ::std::abs(a2) < eps && ::std::abs(a3) < eps &&
      std::abs(a4) < eps)
    return !((::std::max(l1.p1.x, l1.p2.x) < ::std::min(l2.p1.x, l2.p2.x)) ||
             (::std::max(l2.p1.x, l2.p2.x) < ::std::min(l1.p1.x, l1.p2.x)));
  return ((a1 > -eps && a2 > -eps) || (a1 < eps && a2 < eps)) &&
         ((a3 > -eps && a4 > -eps) || (a3 < eps && a4 < eps));
}
point projection(point x, point a, point b) {
  return a + (b - a) * ((x - a).dot(b - a) / (b - a).dot(b - a));
}
point reflection(point x, point a, point b) {
  return x + (projection(x, a, b) - x) * 2;
}
point intersection(point a, point b, point c, point d) {
  return a + (b - a) * ((c - a).cross(d - c) / (b - a).cross(d - c));
}
bool checkIt(point v, point p, point da, point db, point oa, point ob) {
  point pv = v, pp = p, p1, p2;
  line wall, mirror;
  wall.p1 = da;
  wall.p2 = db;
  mirror.p1 = oa;
  mirror.p2 = ob;
  if (!intersect(line(pv, pp), mirror) ||
      ::std::abs((pv - pp).cross(mirror.p1 - mirror.p2)) < eps) {
    if (!intersect(line(pv, pp), wall)) return true;
    {
      double a1 = sarea(pv, mirror.p1, mirror.p2);
      double a2 = sarea(pp, mirror.p1, mirror.p2);
      if (a1 * a2 >= -eps) {
        point pp2 = reflection(pp, mirror.p1, mirror.p2);
        point I = intersection(pv, pp2, mirror.p1, mirror.p2);
        if (!intersect(line(pv, I), wall) && !intersect(line(pp, I), wall) &&
            ::std::min(mirror.p1.x, mirror.p2.x) - eps <= I.x &&
            I.x <= ::std::max(mirror.p1.x, mirror.p2.x) + eps)
          return true;
        return false;
      }
      return false;
    }
  }
  return false;
}
void solve() {
  point v, p;
  point da, db, oa, ob;
  std::cin >> v.x >> v.y;
  std::cin >> p.x >> p.y;
  std::cin >> da.x >> da.y >> db.x >> db.y;
  std::cin >> oa.x >> oa.y >> ob.x >> ob.y;
  if (checkIt(v, p, da, db, oa, ob)) {
    std::cout << "YES\n";
  } else {
    std::cout << "NO\n";
  }
}
int main(int argc, char* argv[]) {
  ::std::ios::sync_with_stdio(false);
  solve();
  return 0;
}
