#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
int dcmp(double u) {
  if (u > eps) return 1;
  if (u < (-eps)) return -1;
  return 0;
}
struct Point {
  double x;
  double y;
  Point() {}
  Point(double u, double v) {
    x = u;
    y = v;
    return;
  }
  void input() {
    scanf("%lf%lf", &x, &y);
    return;
  }
  void output() { printf("%lf %lf\n", x, y); }
  double len() { return sqrt(x * x + y * y); }
  void tolen(double u) {
    double l = len();
    x /= l;
    x *= u;
    y /= l;
    y *= u;
    return;
  }
};
Point er;
Point operator+(Point u, Point v) { return Point(u.x + v.x, u.y + v.y); }
Point operator-(Point u, Point v) { return Point(u.x - v.x, u.y - v.y); }
Point operator*(double u, Point v) { return Point(u * v.x, u * v.y); }
Point operator*(Point v, double u) { return Point(u * v.x, u * v.y); }
double dot(Point u, Point v) { return u.x * v.x + u.y * v.y; }
double det(Point u, Point v) { return u.x * v.y - u.y * v.x; }
bool operator==(Point u, Point v) { return u.x == v.x && u.y == v.y; }
struct Line {
  Point d;
  Point dir;
  Line() {}
  Line(Point d1, Point di) {
    d = d1;
    dir = di;
  }
  void makeline(Point d1, Point d2) {
    d = d1;
    dir = d2 - d1;
  }
  void input() {
    Point d1;
    Point d2;
    d1.input();
    d2.input();
    makeline(d1, d2);
  }
};
Point intersect(Line a, Line b) {
  if (dcmp(det(a.dir, b.dir)) == 0) return er;
  double t;
  t = det(b.d, b.dir) - det(a.d, b.dir);
  t /= det(a.dir, b.dir);
  return a.d + t * a.dir;
}
bool online(Point a, Line b) {
  return dcmp(det(a - b.d, b.dir)) == 0 &&
         dcmp(dot(a - b.d, a - b.d - b.dir)) != 1;
}
Point vertical(Point a, Line b) {
  double l = dot(a - b.d, b.dir) / b.dir.len();
  Point u = b.dir;
  u.tolen(l);
  return u + b.d;
}
Point a1, a2;
Line b1, b2;
int main() {
  er = Point(-1e9, -1e9 + 1e4 + 1e7);
  a1.input();
  a2.input();
  b1.input();
  b2.input();
  Line l;
  l.makeline(a1, a2);
  Point u = intersect(l, b1);
  Point v = intersect(l, b2);
  if (!(online(u, b1) && online(u, l)) && !(online(u, b2) && online(u, l)) &&
      !(online(v, b1) && online(v, l)) && !(online(v, b2) && online(v, l))) {
    if (dcmp(det(l.dir, b1.dir)) == 0 && dcmp(det(b1.dir, a1 - b1.d)) == 0) {
      if (max(l.d.x, l.d.x + l.dir.x) < min(b1.d.x, b1.d.x + b1.dir.x) ||
          min(l.d.x, l.d.x + l.dir.x) > max(b1.d.x, b1.d.x + b1.dir.x)) {
        printf("YES\n");
        return 0;
      }
    } else {
      printf("YES\n");
      return 0;
    }
  }
  if (dcmp(det(a2 - b2.d, b2.dir)) != dcmp(det(a1 - b2.d, b2.dir))) {
    printf("NO\n");
    return 0;
  }
  u = vertical(a1, b2);
  u = 2 * u - a1;
  l.makeline(u, a2);
  v = intersect(l, b2);
  if (v == er || !online(v, b2)) {
    printf("NO\n");
    return 0;
  }
  l.makeline(a1, v);
  u = intersect(l, b1);
  if (online(u, b1) && online(u, l)) {
    printf("NO\n");
    return 0;
  }
  l.makeline(a2, v);
  u = intersect(l, b1);
  if (online(u, b1) && online(u, l)) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  return 0;
}
