#include <bits/stdc++.h>
using namespace std;
const long double eps = 0;
complex<long double> operator*(const complex<long double> &a, double b) {
  return complex<long double>(b, 0) * a;
}
inline void inp(complex<long double> &a) {
  long double x, y;
  cin >> x >> y;
  a = complex<long double>(x, y);
}
inline long double crs(complex<long double> a, complex<long double> b) {
  return imag(a * conj(b));
}
inline long double dot(complex<long double> a, complex<long double> b) {
  return real(a * conj(b));
}
inline bool on(complex<long double> p, complex<long double> a,
               complex<long double> b) {
  return fabs(crs(a - p, b - p)) <= eps && dot(a - p, b - p) <= eps;
}
inline bool inter(complex<long double> a, complex<long double> b,
                  complex<long double> c, complex<long double> d) {
  long double x = crs(c - a, b - a) * crs(b - a, d - a);
  long double y = crs(a - c, d - c) * crs(d - c, b - c);
  if (x < -eps || y < -eps) return false;
  if (fabs(x) <= eps && fabs(y) <= eps) return on(c, a, b) || on(d, a, b);
  return true;
}
inline complex<long double> sym(complex<long double> p, complex<long double> a,
                                complex<long double> b) {
  complex<long double> x = p - a, y = b - a;
  long double alpha = atan(imag(y) / real(y));
  complex<long double> z(cos(-alpha), sin(-alpha));
  return conj(x * z) * conj(z) + a;
}
int main() {
  complex<long double> v, p, w1, w2, m1, m2;
  inp(v);
  inp(p);
  inp(w1);
  inp(w2);
  inp(m1);
  inp(m2);
  if (inter(v, p, m1, m2))
    puts(!inter(v, p, w1, w2) && fabs(crs(m2 - m1, p - v)) <= eps ? "YES"
                                                                  : "NO");
  else if (inter(v, p, w1, w2)) {
    complex<long double> v2 = sym(v, m1, m2), p2 = sym(p, m1, m2);
    puts(inter(v, p2, m1, m2) && !inter(v, p2, w1, w2) && !inter(v2, p, w1, w2)
             ? "YES"
             : "NO");
  } else
    puts("YES");
  return 0;
}
