#include <bits/stdc++.h>
using namespace std;
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
  void input() { scanf("%lf%lf", &x, &y); }
};
struct Segment {
  Point a, b;
  Segment() {}
  Segment(Point _a, Point _b) : a(_a), b(_b) {}
};
struct Line {
  double a, b, c;
};
Point p1, p2, rp2;
Segment wall, mirr;
inline double dotcross(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.x - a.x) + (b.y - a.y) * (c.y - a.y);
}
inline double sqrpdis(Point a, Point b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
inline double difcross(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 SegIntersect(Segment s1, Segment s2) {
  double mxs1x = ((s1.a.x) > (s1.b.x) ? (s1.a.x) : (s1.b.x)),
         mns1x = ((s1.a.x) < (s1.b.x) ? (s1.a.x) : (s1.b.x));
  double mxs2x = ((s2.a.x) > (s2.b.x) ? (s2.a.x) : (s2.b.x)),
         mns2x = ((s2.a.x) < (s2.b.x) ? (s2.a.x) : (s2.b.x));
  double mxs1y = ((s1.a.y) > (s1.b.y) ? (s1.a.y) : (s1.b.y)),
         mns1y = ((s1.a.y) < (s1.b.y) ? (s1.a.y) : (s1.b.y));
  double mxs2y = ((s2.a.y) > (s2.b.y) ? (s2.a.y) : (s2.b.y)),
         mns2y = ((s2.a.y) < (s2.b.y) ? (s2.a.y) : (s2.b.y));
  return ((0) >=
          (difcross(s1.a, s1.b, s2.a) * difcross(s1.a, s1.b, s2.b)) - 1e-8) &&
         ((0) >=
          (difcross(s2.a, s2.b, s1.a) * difcross(s2.a, s2.b, s1.b)) - 1e-8) &&
         ((mxs1x) >= (mns2x)-1e-8) && ((mxs2x) >= (mns1x)-1e-8) &&
         ((mxs1y) >= (mns2y)-1e-8) && ((mxs2y) >= (mns1y)-1e-8);
}
inline bool check() {
  Segment s = Segment(p1, p2);
  if (!SegIntersect(s, wall)) {
    if (!SegIntersect(s, mirr) ||
        ((fabs((difcross(mirr.a, p1, p2)) - (0)) < 1e-8) &&
         (fabs((difcross(mirr.b, p1, p2)) - (0)) < 1e-8)))
      return 1;
  }
  return 0;
}
inline void getline(Point x, Point y, Line &l) {
  l.a = y.y - x.y;
  l.b = x.x - y.x;
  l.c = y.x * x.y - x.x * y.y;
}
bool line_intersect(Line l1, Line l2, Point &p) {
  double d = l1.a * l2.b - l2.a * l1.b;
  if ((fabs((d) - (0)) < 1e-8)) return 0;
  p.x = (l2.c * l1.b - l1.c * l2.b) / d;
  p.y = (l2.a * l1.c - l1.a * l2.c) / d;
  return true;
}
inline bool check2() {
  Segment s;
  Point p3;
  Line l1, l2;
  getline(mirr.a, mirr.b, l2);
  double a1 = l2.a, b1 = l2.b, c1 = l2.c;
  p3.x = ((((b1) * (b1)) - ((a1) * (a1))) * p2.x - 2 * a1 * b1 * p2.y -
          2 * a1 * c1) /
         (((a1) * (a1)) + ((b1) * (b1)));
  p3.y = ((((a1) * (a1)) - ((b1) * (b1))) * p2.y - 2 * a1 * b1 * p2.x -
          2 * b1 * c1) /
         (((a1) * (a1)) + ((b1) * (b1)));
  rp2 = p3;
  Point tt;
  getline(p1, rp2, l1);
  line_intersect(l1, l2, tt);
  if (!(tt.x >= ((mirr.a.x) < (mirr.b.x) ? (mirr.a.x) : (mirr.b.x)) &&
        tt.x <= ((mirr.a.x) > (mirr.b.x) ? (mirr.a.x) : (mirr.b.x)) &&
        tt.y >= ((mirr.a.y) < (mirr.b.y) ? (mirr.a.y) : (mirr.b.y)) &&
        tt.y <= ((mirr.a.y) > (mirr.b.y) ? (mirr.a.y) : (mirr.b.y))))
    return 0;
  s = Segment(p2, tt);
  if (SegIntersect(s, wall)) return 0;
  s = Segment(p1, tt);
  if (SegIntersect(s, wall)) return 0;
  return 1;
}
int main() {
  p1.input();
  p2.input();
  wall.a.input();
  wall.b.input();
  mirr.a.input();
  mirr.b.input();
  Segment s1, s2;
  s1 = Segment(p1, p2);
  if (!SegIntersect(s1, wall))
    if (!SegIntersect(s1, mirr) ||
        ((fabs((difcross(mirr.a, p1, p2)) - (0)) < 1e-8) &&
         (fabs((difcross(mirr.b, p1, p2)) - (0)) < 1e-8))) {
      printf("YES\n");
      return 0;
    }
  double a1, b1, c1;
  Line l1, l2;
  Point p3;
  getline(mirr.a, mirr.b, l1);
  a1 = l1.a;
  b1 = l1.b;
  c1 = l1.c;
  p3.x = ((((b1) * (b1)) - ((a1) * (a1))) * p2.x - 2 * a1 * b1 * p2.y -
          2 * a1 * c1) /
         (((a1) * (a1)) + ((b1) * (b1)));
  p3.y = ((((a1) * (a1)) - ((b1) * (b1))) * p2.y - 2 * a1 * b1 * p2.x -
          2 * b1 * c1) /
         (((a1) * (a1)) + ((b1) * (b1)));
  if ((((difcross(mirr.a, mirr.b, p1) * difcross(mirr.a, mirr.b, p2))) >=
       (0) - 1e-8)) {
    int flag = 1;
    Point mid;
    getline(p1, p3, l2);
    line_intersect(l1, l2, mid);
    if (!(mid.x >= ((mirr.a.x) < (mirr.b.x) ? (mirr.a.x) : (mirr.b.x)) &&
          mid.x <= ((mirr.a.x) > (mirr.b.x) ? (mirr.a.x) : (mirr.b.x)) &&
          mid.y >= ((mirr.a.y) < (mirr.b.y) ? (mirr.a.y) : (mirr.b.y)) &&
          mid.y <= ((mirr.a.y) > (mirr.b.y) ? (mirr.a.y) : (mirr.b.y))))
      flag = 0;
    s1 = Segment(p1, mid);
    s2 = Segment(p2, mid);
    if (SegIntersect(s1, wall)) flag = 0;
    if (SegIntersect(s2, wall)) flag = 0;
    if (flag) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
