#include <bits/stdc++.h>
using namespace std;
const double Eps = 1e-8;
struct point {
  double x, y;
};
point v, p, w1, w2, m1, m2, o, _p;
void input() {
  scanf("%lf%lf", &v.x, &v.y);
  scanf("%lf%lf", &p.x, &p.y);
  scanf("%lf%lf%lf%lf", &w1.x, &w1.y, &w2.x, &w2.y);
  scanf("%lf%lf%lf%lf", &m1.x, &m1.y, &m2.x, &m2.y);
}
double muilt(point A, point B, point C) {
  return (B.x - A.x) * (C.y - A.y) - (B.y - A.y) * (C.x - A.x);
}
double dis(point A, point B) {
  return sqrt(((A.x - B.x) * (A.x - B.x)) + ((A.y - B.y) * (A.y - B.y)));
}
bool block(point A, point B, point C, point D) {
  if (abs(muilt(A, B, C)) < Eps && abs(muilt(A, B, D)) < Eps)
    return abs(dis(A, C) + dis(C, B) - dis(A, B)) < Eps;
  if (muilt(C, D, A) * muilt(C, D, B) > Eps) return false;
  if (muilt(A, B, C) * muilt(A, B, D) > Eps) return false;
  return true;
}
point cross(point A, point B, point C, point D) {
  double c = abs(muilt(A, B, C));
  double d = abs(muilt(A, B, D));
  point E = C;
  E.x += (D.x - C.x) * c / (c + d);
  E.y += (D.y - C.y) * c / (c + d);
  return E;
}
point mirror(point A, point B, point C) {
  double a = dis(B, C), b = dis(A, C), c = dis(A, B);
  double cosa = (((b) * (b)) + ((c) * (c)) - ((a) * (a))) / (2 * b * c);
  double sina = sqrt(1 - ((cosa) * (cosa)));
  if (muilt(A, B, C) > Eps) sina = -sina;
  point D;
  D.x = C.x - A.x, D.y = C.y - A.y;
  C.x = D.x * cosa - D.y * sina;
  C.y = D.x * sina + D.y * cosa;
  D = C;
  C.x = D.x * cosa - D.y * sina;
  C.y = D.x * sina + D.y * cosa;
  C.x += A.x, C.y += A.y;
  return C;
}
bool solve() {
  if (abs(muilt(v, p, m1)) < Eps && abs(muilt(v, p, m2)) < Eps)
    return !block(v, p, w1, w2);
  if (!block(v, p, m1, m2) && !block(v, p, w1, w2)) return true;
  _p = mirror(m1, m2, p);
  if (block(v, _p, m1, m2)) {
    o = cross(v, _p, m1, m2);
    if (!block(v, o, w1, w2) && !block(o, p, w1, w2)) return true;
  }
  return false;
}
int main() {
  input();
  if (solve())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
