#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
  long long id;
  bool operator<(point other) const {
    if (x != other.x) return x < other.x;
    return y < other.y;
  }
};
long long cross(point o, point a, point b) {
  return (a.x - o.x) * (long long)(b.y - o.y) -
         (a.y - o.y) * (long long)(b.x - o.x);
}
bool onSegment(point p, point q, point r) {
  if (q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) &&
      q.y >= min(p.y, r.y))
    return true;
  return false;
}
long long orientation(point p, point q, point r) {
  long long val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
bool doIntersect(point p1, point q1, point p2, point q2) {
  long long o1 = orientation(p1, q1, p2);
  long long o2 = orientation(p1, q1, q2);
  long long o3 = orientation(p2, q2, p1);
  long long o4 = orientation(p2, q2, q1);
  if (o1 != o2 && o3 != o4) return true;
  if (o1 == 0 && onSegment(p1, p2, q1)) return true;
  if (o2 == 0 && onSegment(p1, q2, q1)) return true;
  if (o3 == 0 && onSegment(p2, p1, q2)) return true;
  if (o4 == 0 && onSegment(p2, q1, q2)) return true;
  return false;
}
vector<point> convexHull(vector<point> P) {
  long long n = P.size(), k = 0;
  vector<point> H(2 * n);
  sort(P.begin(), P.end());
  for (long long i = 0; i < n; ++i) {
    while (k >= 2 && cross(H[k - 2], H[k - 1], P[i]) <= 0) {
      --k;
    }
    H[k++] = P[i];
  }
  for (long long i = n - 1, t = k + 1; i >= 0; --i) {
    while (k >= t && cross(H[k - 2], H[k - 1], P[i]) <= 0) {
      --k;
    }
    H[k++] = P[i];
  }
  H.resize(k);
  return H;
}
int main() {
  vector<point> points;
  set<point> sq1, sq2;
  vector<point> s1, s2;
  for (long long i = 0; i < 4; ++i) {
    long long x, y;
    scanf("%I64d%I64d", &x, &y);
    sq1.insert({x, y});
    s1.push_back({x, y});
    points.push_back({x, y});
  }
  for (long long i = 0; i < 4; ++i) {
    long long x, y;
    scanf("%I64d%I64d", &x, &y);
    sq2.insert({x, y});
    s2.push_back({x, y});
    points.push_back({x, y});
  }
  vector<point> hull = convexHull(points);
  long long f1 = 0, f2 = 0;
  for (long long i = 0; i < hull.size() - 1; ++i) {
    if (sq1.find(hull[i]) != sq1.end()) {
      ++f1;
    }
    if (sq2.find(hull[i]) != sq2.end()) {
      ++f2;
    }
  }
  if (f1 == 4 && !f2) {
    return !printf("YES\n");
  }
  if (f2 == 4 && !f1) {
    return !printf("YES\n");
  }
  for (int i = 0; i < s1.size(); ++i) {
    point p1 = s1[i], q1 = s1[(i + 1) % 4];
    for (int j = 0; j < s2.size(); ++j) {
      point p2 = s2[j], q2 = s2[(j + 1) % 4];
      if (doIntersect(p1, q1, p2, q2)) {
        printf("YES\n");
        return 0;
      }
    }
  }
  printf("NO\n");
}
