#include <bits/stdc++.h>
using namespace std;
pair<double, double> p1, p2;
pair<pair<double, double>, pair<double, double> > st, st2, z;
bool prin(pair<double, double> p1, pair<double, double> p2,
          pair<double, double> p) {
  if (p1.first > p2.first) swap(p1.first, p2.first);
  if (p1.second > p2.second) swap(p1.second, p2.second);
  if (p1.first < p.first + 1e-7 && p2.first > p.first - 1e-7 &&
      p1.second < p.second + 1e-7 && p2.second > p.second - 1e-7)
    return true;
  else
    return false;
}
pair<double, double> cross_lines(double a1, double b1, double c1, double a2,
                                 double b2, double c2) {
  pair<double, double> res;
  res.second = -(a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1);
  res.first = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
  return res;
}
bool cross(pair<double, double> v1, pair<double, double> v2,
           pair<double, double> u1, pair<double, double> u2, int zn) {
  double a1 = v1.second - v2.second;
  double b1 = v2.first - v1.first;
  double c1 = -v1.second * v2.first + v2.second * v1.first;
  double a2 = u1.second - u2.second;
  double b2 = u2.first - u1.first;
  double c2 = -u1.second * u2.first + u2.second * u1.first;
  if (fabs(a1 * b2 - a2 * b1) < 1e-7) {
    if (fabs(a1 * c2 - a2 * c1) > 1e-7) return false;
    if (prin(u1, u2, v1) && zn == 0) return true;
    return false;
  }
  pair<double, double> tmp = cross_lines(a1, b1, c1, a2, b2, c2);
  if (prin(v1, v2, tmp) && prin(u1, u2, tmp))
    return true;
  else
    return false;
}
void answer(char *ans) {
  cout << ans << endl;
  exit(0);
}
int zn(pair<double, double> p1, pair<double, double> p2,
       pair<double, double> p) {
  double a = p1.second - p2.second;
  double b = p2.first - p1.first;
  double c = -p1.second * p2.first + p2.second * p1.first;
  if (a * p.first + b * p.second + c > 1e-5) return 1;
  if (a * p.first + b * p.second + c < -1e-5) return -1;
  return 0;
}
pair<double, double> sim(pair<double, double> p1, pair<double, double> p2,
                         pair<double, double> p) {
  double a = p1.second - p2.second;
  double b = p2.first - p1.first;
  double c = -p1.second * p2.first + p2.second * p1.first;
  double aa = -b;
  double bb = a;
  double cc = -aa * p.first - bb * p.second;
  pair<double, double> tmp = cross_lines(a, b, c, aa, bb, cc);
  p.first = 2 * tmp.first - p.first;
  p.second = 2 * tmp.second - p.second;
  return p;
}
int main() {
  cin >> p1.first >> p1.second >> p2.first >> p2.second;
  cin >> st.first.first >> st.first.second >> st.second.first >>
      st.second.second;
  cin >> z.first.first >> z.first.second >> z.second.first >> z.second.second;
  if (!cross(st.first, st.second, p1, p2, 0)) {
    if (!cross(z.first, z.second, p1, p2, 1))
      answer("YES");
    else
      answer("NO");
  }
  if (zn(z.first, z.second, p1) * zn(z.first, z.second, p2) <= 0) answer("NO");
  p2 = sim(z.first, z.second, p2);
  st2.first = sim(z.first, z.second, st.first);
  st2.second = sim(z.first, z.second, st.second);
  if (cross(z.first, z.second, p1, p2, 1) &&
      !cross(st.first, st.second, p1, p2, 0) &&
      !cross(st2.first, st2.second, p1, p2, 0))
    answer("YES");
  else
    answer("NO");
  return 0;
}
