#include <bits/stdc++.h>
using namespace std;
struct Pt {
  double x, y;
  Pt() : x(0), y(0) {}
  Pt(const double& x, const double& y) : x(x), y(y) {}
  void swap(Pt& other) {
    using std::swap;
    swap(x, other.x);
    swap(y, other.y);
  }
  Pt& operator=(const Pt& other) {
    x = other.x;
    y = other.y;
    return *this;
  }
  double square() { return x * x + y * y; }
  double absolute() { return sqrt((double)square()); }
  double argument() {
    complex<double> _cc{(double)x, (double)y};
    if (arg(_cc) < 0) return arg(_cc) + 2 * acos(-1.0);
    return arg(_cc);
  }
  Pt operator+(const Pt& other) { return {(x + other.x), (y + other.y)}; }
  Pt operator-(const Pt other) { return {(x - other.x), (y - other.y)}; }
  Pt operator*(const Pt& other) { return {(x * other.x), (y * other.y)}; }
  Pt operator*(const double& factor) { return {(x * factor), (y * factor)}; }
  Pt operator/(const Pt& other) { return {(x / other.x), (y / other.y)}; }
  Pt operator/(const double& factor) { return {(x / factor), (y / factor)}; }
};
istream& operator>>(istream& is, Pt& Pt) { return is >> Pt.x >> Pt.y; }
ostream& operator<<(ostream& os, const Pt& Pt) {
  return os << Pt.x << ' ' << Pt.y;
}
bool isEqual(Pt& p, Pt& q) { return (p.x == q.x && p.y == q.y); }
Pt Translate(Pt& p, Pt& v) { return p + v; }
Pt Scale(Pt& c, double factor, Pt& p) {
  Pt k{factor, factor};
  k = k * (p - c);
  return {c + k};
}
Pt Rotate(Pt p, double d) {
  return {p.x * cos(d) - p.y * sin(d), p.x * sin(d) + p.y * cos(d)};
}
Pt linearTransfo(Pt p, Pt q, Pt r, Pt fp, Pt fq) {
  q = q - p;
  r = r - p;
  fq = fq - fp;
  return fp + r * (fq / q);
}
double dotProduct(Pt v, Pt w) { return v.x * w.x + v.y * w.y; }
bool isPerpendicular(const Pt v, const Pt w) { return dotProduct(v, w) == 0; }
double smallAngle(Pt v, Pt w) {
  double cosTheta = (double)dotProduct(v, w) / (v.absolute() * w.absolute());
  if (cosTheta < -1) cosTheta = -1;
  if (cosTheta > 1) cosTheta = 1;
  return acos(cosTheta);
}
double crossProduct(Pt v, Pt w) { return v.x * w.y - v.y * w.x; }
double orientation(Pt a, Pt b, Pt c) {
  Pt r = b - a;
  return crossProduct(b - a, c - a);
}
bool isInAngle(Pt a, Pt b, Pt c, Pt p) {
  assert(orientation(a, b, c) != 0);
  if (orientation(a, b, c) < 0) swap(b, c);
  return orientation(a, b, p) >= 0 && orientation(a, c, p) <= 0;
}
bool isConvex(vector<Pt>& v) {
  bool hasPos = false, hasNeg = false;
  for (int i = 0, n = v.size(); i < n; i++) {
    double o = orientation(v[i], v[(i + 1) % n], v[(i + 2) % n]);
    if (o > 0) hasPos = true;
    if (o < 0) hasNeg = true;
  }
  return !(hasPos && hasNeg);
}
bool half(Pt p) { return p.y > 0 || (p.y == 0 && p.x < 0); }
void polarSort(vector<Pt>& k) {
  sort(k.begin(), k.end(), [](Pt v, Pt w) {
    return make_tuple(half(v), 0) < make_tuple(half(w), crossProduct(v, w));
  });
}
struct Line {
  Pt v;
  double c;
  Line(Pt p, Pt q) : v(q - p), c(crossProduct(v, p)){};
  Line(double a, double b, double c) : v({b, -a}), c(c){};
  Line(Pt v, double c) : v(v), c(c){};
  double side(Pt p) { return crossProduct(v, p) - c; }
  double distanceFromPoint(Pt p) { return fabs(side(p)) / v.absolute(); }
  Line perpendicularThrough(Pt p) { return {p, p + Rotate(v, acos(-1.0) / 2)}; }
  bool cmpProjection(Pt p, Pt q) { return dotProduct(v, p) < dotProduct(v, q); }
  void sortingAlong_a_line(vector<Pt>& vec) {
    sort(vec.begin(), vec.end(),
         [&](Pt p, Pt q) { return dotProduct(v, p) < dotProduct(v, q); });
  }
  Line Translate(Pt t) { return {v, c + crossProduct(v, t)}; }
  Line shiftLeft(double dist) { return {v, c + dist * v.absolute()}; }
  bool intersection(Line other, Pt& point) {
    double d = crossProduct(v, other.v);
    if (d == 0) return false;
    point = (other.v * c - v * other.c) / d;
    return true;
  }
  Pt projection(Pt p) {
    return {p - Rotate(v, acos(-1.0) / 2) * side(p) / v.square()};
  }
  Pt reflection(Pt p) {
    return {p - Rotate(v, acos(-1.0) / 2) * 2 * side(p) / v.square()};
  }
  Line bisector(Line other, bool interior) {
    double sign = interior ? 1 : -1;
    return {other.v / other.v.absolute() + (v / v.absolute()) * sign,
            other.c / other.v.absolute() + (c / v.absolute()) * sign};
  }
};
bool onDisk(Pt a, Pt b, Pt p) { return dotProduct(a - p, b - p) <= 0; }
bool onSegment(Pt a, Pt b, Pt p) {
  return orientation(a, b, p) == 0 && onDisk(a, b, p);
}
bool properIntersection(Pt a, Pt b, Pt c, Pt d, Pt& r) {
  double oa = orientation(c, d, a), ob = orientation(c, d, b),
         oc = orientation(a, b, c), od = orientation(a, b, d);
  if (oa * ob < 0 && oc * od < 0) {
    r = (a * ob - b * oa) / (ob - oa);
    return true;
  }
  return false;
}
bool intersection(Pt a, Pt b, Pt c, Pt d) {
  Pt out;
  if (properIntersection(a, b, c, d, out)) return true;
  vector<Pt> s;
  if (onSegment(c, d, a)) s.push_back(a);
  if (onSegment(c, d, b)) s.push_back(b);
  if (onSegment(a, b, c)) s.push_back(c);
  if (onSegment(a, b, d)) s.push_back(d);
  return (s.size() > 0);
}
double segmentPointDistance(Pt a, Pt b, Pt p) {
  if (!isEqual(a, b)) {
    Line l(a, b);
    if (l.cmpProjection(a, p) && l.cmpProjection(p, b))
      return l.distanceFromPoint(p);
  }
  return min(((Pt)(p - a)).absolute(), ((Pt)(p - b)).absolute());
}
double segmentSegmentDistance(Pt a, Pt b, Pt c, Pt d) {
  Pt dummy;
  if (properIntersection(a, b, c, d, dummy)) return 0;
  double mini = (1e6);
  mini = min(mini, segmentPointDistance(a, b, c));
  mini = min(mini, segmentPointDistance(a, b, d));
  mini = min(mini, segmentPointDistance(c, d, a));
  mini = min(mini, segmentPointDistance(c, d, b));
  return mini;
}
double deg(double rd) { return (rd * 180) / acos(-1.0); }
double rad(double dg) { return (dg * acos(-1.0)) / 180; }
int main() {
  vector<Pt> one, two, v;
  Pt a, b, c, d;
  cin >> a >> b >> c >> d;
  one.push_back(a);
  one.push_back(b);
  one.push_back(c);
  one.push_back(d);
  cin >> a >> b >> c >> d;
  two.push_back(a);
  two.push_back(b);
  two.push_back(c);
  two.push_back(d);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      a = one[i];
      b = one[(i + 1) % 4];
      c = two[j];
      d = two[(j + 1) % 4];
      if (intersection(a, b, c, d)) return cout << "YES\n", 0;
    }
  }
  bool ans1 = true, ans3 = false;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      a = one[i];
      b = one[(i + 1) % 4];
      ans1 &= (orientation(a, b, two[j]) > 0);
      ans3 |= (orientation(a, b, two[j]) > 0);
    }
  }
  ans1 = (ans1 || !ans3) ? true : false;
  bool ans2 = true, ans4 = false;
  for (int j = 0; j < 4; j++) {
    for (int i = 0; i < 4; i++) {
      a = two[j];
      b = two[(j + 1) % 4];
      ans2 &= (orientation(a, b, one[i]) > 0);
      ans4 |= (orientation(a, b, one[i]) > 0);
    }
  }
  ans2 = (ans2 || !ans4) ? true : false;
  if (ans1 || ans2)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
