#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
inline long double tabs(long double x) { return x < 0 ? -x : x; }
inline long double tmin(long double a, long double b) { return a < b ? a : b; }
inline long double sq(long double x) { return x * x; }
inline int tcmp(long double a, long double b = 0) {
  return (a + EPS < b ? -1 : (b + EPS < a ? 1 : 0));
}
struct V {
  long double x, y;
  V operator+(const V& o) const { return V(x + o.x, y + o.y); }
  V operator-(const V& o) const { return V(x - o.x, y - o.y); }
  V operator*(long double m) const { return V(x * m, y * m); }
  V operator/(long double m) const { return V(x / m, y / m); }
  long double cross(const V& o) const { return x * o.y - y * o.x; }
  long double dot(const V& o) const { return x * o.x + y * o.y; }
  V rot90CW() { return V(y, -x); }
  V rot90CCW() { return V(-y, x); }
  long double len() { return hypot(x, y); }
  long double sqLen() { return sq(x) + sq(y); }
  V(long double x, long double y) : x(x), y(y) {}
  V() {}
};
struct R {
  V s, d;
  V at(long double m) { return V(s.x + m * d.x, s.y + m * d.y); }
  R perp(long double m = 0.5) { return R(at(m), d.rot90CW()); }
  long double interVal(const R& o) {
    return (o.s - s).cross(o.d) / d.cross(o.d);
  }
  V intersection(const R& o) { return at(interVal(o)); }
  bool contains(const V& p) { return tcmp(cross(p)) == 0; }
  bool parallel(const R& o) { return tcmp(d.cross(o.d)) == 0; }
  bool sameLine(const R& o) { return parallel(o) && contains(o.s); }
  bool intersects(const R& o) { return !parallel(o) || sameLine(o); }
  long double dist(V p) { return tabs((s - p).cross(s + d - p)) / d.len(); }
  long double cross(const V& p) { return d.cross(p - s); }
  R() {}
  R(const V& a, const V& b) : s(a), d(b) {}
};
R newR(V s, V t) { return R(s, t - s); }
V projection(V p, R l) {
  return l.s + l.d * ((p - l.s).dot(l.d) / l.d.dot(l.d));
}
bool intersectsRaySeg(R r, R s) {
  int s1 = tcmp(r.cross(s.s));
  int s2 = tcmp(r.cross(s.s + s.d));
  return (s1 == 0 || s2 == 0 || s1 != s2);
}
bool intersectsSegSeg(R a, R b) {
  if (a.parallel(b)) {
    if (!a.contains(b.s)) return false;
    long double a1 = a.s.x, b1 = b.s.x;
    long double a2 = a1 + a.d.x, b2 = b1 + b.d.x;
    if (tcmp(a1, a2) > 0) swap(a1, a2);
    if (tcmp(b1, b2) > 0) swap(b1, b2);
    return !(tcmp(a2, b1) < 0 || tcmp(a1, b2) > 0);
  }
  return intersectsRaySeg(a, b) && intersectsRaySeg(b, a);
}
bool containsSegPnt(R s, V p) {
  if (!s.contains(p)) return false;
  long double sx = s.s.x, bx = s.s.x + s.d.x;
  if (sx > bx) swap(sx, bx);
  return tcmp(sx, p.x) <= 0 && tcmp(p.x, bx) <= 0;
}
void readSeg(R& seg) {
  cin >> seg.s.x >> seg.s.y;
  cin >> seg.d.x >> seg.d.y;
  seg.d = (seg.d - seg.s);
}
int main() {
  V a, b;
  cin >> a.x >> a.y;
  cin >> b.x >> b.y;
  R wall, mirror;
  readSeg(wall);
  readSeg(mirror);
  if (intersectsSegSeg(mirror, newR(a, b)) && !mirror.parallel(newR(a, b))) {
    printf("NO\n");
    return 0;
  };
  if (!intersectsSegSeg(wall, newR(a, b))) {
    printf("YES\n");
    return 0;
  };
  V mirrorP;
  {
    V mA = projection(a, mirror);
    V mB = projection(b, mirror);
    double dA = mirror.dist(a);
    double dB = mirror.dist(b);
    double x = dA / (dA + dB);
    mirrorP = newR(mA, mB).at(x);
    if (!containsSegPnt(mirror, mirrorP)) {
      printf("NO\n");
      return 0;
    };
  }
  if (intersectsSegSeg(newR(a, mirrorP), wall)) {
    printf("NO\n");
    return 0;
  };
  if (intersectsSegSeg(newR(mirrorP, b), wall)) {
    printf("NO\n");
    return 0;
  };
  {
    printf("YES\n");
    return 0;
  };
}
