#include <bits/stdc++.h>
using namespace std;
const double Eps = 1e-9;
struct Point {
  double x, y;
} a, b, pa, pb, qa, qb;
inline double dis(Point a, Point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
inline double ral(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
inline bool sameline(Point a, Point b, Point c) {
  return dis(a, b) + dis(b, c) - dis(a, c) < Eps;
}
inline bool sameline(Point a, Point b, Point c, Point d) {
  return sameline(a, c, b) && sameline(a, d, b);
}
inline bool cross(Point a, Point b, Point c, Point d, bool mirror) {
  if (mirror && sameline(a, b, c, d)) return false;
  if (sameline(a, c, b) || sameline(a, d, b) || sameline(c, a, d) ||
      sameline(c, b, d))
    return true;
  return ral(a, b, c) * ral(a, b, d) < -Eps &&
         ral(c, d, a) * ral(c, d, b) < -Eps;
}
inline Point inter(Point a, Point b, Point c, Point d) {
  double p1 = b.y - a.y, q1 = -(b.x - a.x), r1 = a.x * b.y - a.y * b.x;
  double p2 = d.y - c.y, q2 = -(d.x - c.x), r2 = c.x * d.y - c.y * d.x;
  if (fabs(p2 * q1 - p1 * q2) < Eps || fabs(q2 * p1 - q1 * p2) < Eps) {
    printf("NO\n");
    exit(0);
  }
  double y = (r1 * p2 - r2 * p1) / (p2 * q1 - p1 * q2);
  double x = (r1 * q2 - r2 * q1) / (q2 * p1 - q1 * p2);
  return (Point){x, y};
}
int main() {
  cin >> a.x >> a.y;
  cin >> b.x >> b.y;
  cin >> pa.x >> pa.y >> pb.x >> pb.y;
  cin >> qa.x >> qa.y >> qb.x >> qb.y;
  if (!cross(a, b, pa, pb, false) && !cross(a, b, qa, qb, true))
    printf("YES\n");
  else {
    Point r, t;
    t.x = a.x - qa.y + qb.y;
    t.y = a.y + qa.x - qb.x;
    r = inter(a, t, qa, qb);
    t.x = 2 * r.x - a.x;
    t.y = 2 * r.y - a.y;
    r = inter(b, t, qa, qb);
    if (!cross(b, t, qa, qb, false))
      printf("NO\n");
    else {
      Point c = inter(b, r, qa, qb);
      if (!cross(a, c, pa, pb, false) && !cross(b, c, pa, pb, false))
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
