#include <bits/stdc++.h>
using namespace std;
using namespace rel_ops;
const double EPS = 1e-12, MAGIC = 2.71828e18;
inline double sqr(double a) { return a * a; }
inline double cmp(double a, double b) {
  return fabs(a - b) >= EPS + fabs(a) * EPS ? a - b : 0;
}
struct VEC {
  double x, y;
} NOVEC = {MAGIC, MAGIC};
struct RAY {
  VEC u, v;
} NORAY = {NOVEC, NOVEC};
struct CIR {
  VEC u;
  double r;
} NOCIR = {NOVEC, MAGIC};
inline double sqr(const VEC& a) { return sqr(a.x) + sqr(a.y); }
inline double abs(const VEC& a) { return sqrt(sqr(a)); }
inline double cmp(const VEC& a, const VEC& b) {
  double at = cmp(a.x, b.x);
  return !at ? cmp(a.y, b.y) : at;
}
inline VEC operator+(const VEC& a, const VEC& b) {
  return (VEC){a.x + b.x, a.y + b.y};
}
inline VEC operator-(const VEC& a, const VEC& b) {
  return (VEC){a.x - b.x, a.y - b.y};
}
inline double operator*(const VEC& a, const VEC& b) {
  return a.x * b.y - a.y * b.x;
}
inline double operator%(const VEC& a, const VEC& b) {
  return a.x * b.x + a.y * b.y;
}
inline VEC operator-(const VEC& a) { return (VEC){-a.x, -a.y}; }
inline VEC operator~(const VEC& a) { return (VEC){-a.y, +a.x}; }
inline VEC operator*(double u, const VEC& a) { return (VEC){u * a.x, u * a.y}; }
inline VEC operator*(const VEC& a, double u) { return (VEC){a.x * u, a.y * u}; }
inline VEC operator/(const VEC& a, double u) { return (VEC){a.x / u, a.y / u}; }
inline VEC operator/(const VEC& a, const VEC& b) { return a % b / sqr(b) * b; }
inline bool operator==(const VEC& a, const VEC& b) { return !cmp(a, b); }
inline bool operator<(const VEC& a, const VEC& b) { return cmp(a, b) < 0; }
double cmp_side(const VEC& a, const VEC& b) {
  return cmp(a.x * b.y, +a.y * b.x);
}
double cmp_axis(const VEC& a, const VEC& b) {
  return cmp(a.x * b.x, -a.y * b.y);
}
VEC project(const VEC& p, const RAY& l) {
  return (p - l.u) / (l.v - l.u) + l.u;
}
VEC intersect(const RAY& a, const RAY& b) {
  VEC s = a.u - a.v, t = b.u - b.v;
  double at = cmp_side(s, t);
  if (!at) return NOVEC;
  return a.u + (b.u - a.u) * t / at * s;
}
int relation(const VEC& p, const RAY& l) {
  if (cmp_side(p - l.u, p - l.v)) return 0;
  return cmp_axis(p - l.u, p - l.v) > 0 ? 1 : 2;
}
int main() {
  VEC v, p;
  RAY w, m;
  scanf("%lf%lf", &v.x, &v.y);
  scanf("%lf%lf", &p.x, &p.y);
  scanf("%lf%lf%lf%lf", &w.u.x, &w.u.y, &w.v.x, &w.v.y);
  scanf("%lf%lf%lf%lf", &m.u.x, &m.u.y, &m.v.x, &m.v.y);
  RAY d = {v, p};
  VEC dw = intersect(d, w), dm = intersect(d, m);
  if (!(dw == NOVEC && (relation(w.u, d) == 2 || relation(w.v, d) == 2)) &&
      !(dw != NOVEC && relation(dw, d) == 2 && relation(dw, w) == 2) &&
      !(dm != NOVEC && relation(dm, d) == 2 && relation(dm, m) == 2))
    return puts("YES"), 0;
  RAY f = {v, 2 * project(p, m) - p};
  VEC o = intersect(f, m);
  if (o == NOVEC || relation(o, m) != 2 || relation(o, f) != 2)
    return puts("NO"), 0;
  RAY l = {v, o}, r = {o, p};
  VEC lw = intersect(l, w), rw = intersect(r, w);
  if ((lw == NOVEC && (relation(w.u, l) == 2 || relation(w.v, l) == 2)) ||
      (rw == NOVEC && (relation(w.u, r) == 2 || relation(w.v, r) == 2)) ||
      (lw != NOVEC && relation(lw, l) == 2 && relation(lw, w) == 2) ||
      (rw != NOVEC && relation(rw, r) == 2 && relation(rw, w) == 2))
    return puts("NO"), 0;
  puts("YES");
}
