#include <bits/stdc++.h>
using namespace std;
struct Point {
  double x, y;
} p1, p2, w1, w2, m1, m2;
Point operator-(const Point &i, const Point &j) {
  Point ret = {i.x - j.x, i.y - j.y};
  return ret;
}
void Init() {
  scanf("%lf %lf", &p1.x, &p1.y);
  scanf("%lf %lf", &p2.x, &p2.y);
  scanf("%lf %lf", &w1.x, &w1.y);
  scanf("%lf %lf", &w2.x, &w2.y);
  scanf("%lf %lf", &m1.x, &m1.y);
  scanf("%lf %lf", &m2.x, &m2.y);
}
double det(const Point &i, const Point &j) { return i.x * j.y - i.y * j.x; }
bool Solve() {
  if (det(w1 - p1, p2 - p1) * det(w2 - p1, p2 - p1) > 0 ||
      det(p1 - w1, w2 - w1) * det(p2 - w1, w2 - w1) > 0 ||
      max(p1.x, p2.x) < min(w1.x, w2.x) || min(p1.x, p2.x) > max(w1.x, w2.x)) {
    if (det(m1 - p1, p2 - p1) * det(m2 - p1, p2 - p1) > 0 ||
        det(p1 - m1, m2 - m1) * det(p2 - m1, m2 - m1) > 0 ||
        (fabs(det(m1 - p1, p2 - p1)) < 1e-10 &&
         fabs(det(m2 - p1, p2 - p1)) < 1e-10))
      return 1;
    else
      return 0;
  }
  double s1 = det(m1 - m2, p1 - m2), s2 = det(m1 - m2, p2 - m2);
  if (s1 * s2 < 1e-10) return 0;
  double r = s1 / s2, A = m2.y - m1.y, B = m1.x - m2.x;
  Point q = {p2.x * r / (1 + r) + p1.x / (1 + r),
             p2.y * r / (1 + r) + p1.y / (1 + r)},
        D = {A, B};
  if (det(D, m1 - q) * det(D, m2 - q) > 1e-10) return 0;
  double t = det(m2 - m1, q - m1) / det(D, m2 - m1);
  Point h = {q.x + D.x * t, q.y + D.y * t};
  if (det(h - p1, w1 - p1) * det(h - p1, w2 - p1) < 1e-10 &&
      det(w2 - w1, h - w1) * det(w2 - w1, p1 - w1) < 1e-10)
    return 0;
  if (det(h - p2, w1 - p2) * det(h - p2, w2 - p2) < 1e-10 &&
      det(w2 - w1, h - w1) * det(w2 - w1, p2 - w1) < 1e-10)
    return 0;
  return 1;
}
int main() {
  Init();
  printf("%s\n", Solve() ? "YES" : "NO");
  return 0;
}
