#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[4], q[4];
double sgn(double x) {
  if (x < -1e-9) return -1;
  if (x > 1e-9) return 1;
  return 0;
}
struct pnt {
  double x, y;
  pnt() {}
  pnt(double _x, double _y) {
    x = _x;
    y = _y;
  }
  void inp() { scanf("%lf%lf", &x, &y); }
  pnt rotate90() { return pnt(-y, x); }
} a[22], b[22];
pnt operator+(const pnt& a, const pnt& b) { return pnt(a.x + b.x, a.y + b.y); }
pnt operator-(const pnt& a, const pnt& b) { return pnt(a.x - b.x, a.y - b.y); }
pnt operator*(const pnt& a, double x) { return pnt(a.x * x, a.y * x); }
pnt operator/(const pnt& a, double x) { return pnt(a.x / x, a.y / x); }
double operator*(const pnt& a, const pnt& b) { return a.x * b.y - a.y * b.x; }
pnt intersect(const pnt& a, const pnt& b, const pnt& c, const pnt& d) {
  double t = ((a - c) * (c - d)) / ((a - b) * (c - d));
  return a + (b - a) * t;
}
bool chk(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  bool res = a.first * b.second + b.first * c.second + c.first * a.second -
                 a.second * b.first - b.second * c.first - c.second * a.first >=
             0;
  return res;
}
bool chk_s(pair<pnt, pnt> seg_a, pair<pnt, pnt> seg_b) {
  pnt p = intersect(seg_a.first, seg_a.second, seg_b.first, seg_b.second);
  int mi = min(seg_b.first.x, seg_b.second.x);
  int ma = max(seg_b.first.x, seg_b.second.x);
  if (p.x < mi || p.x > ma) return false;
  mi = min(seg_a.first.x, seg_a.second.x);
  ma = max(seg_a.first.x, seg_a.second.x);
  if (p.x < mi || p.x > ma) return false;
  mi = min(seg_a.first.y, seg_a.second.y);
  ma = max(seg_a.first.y, seg_a.second.y);
  if (p.y < mi || p.y > ma) return false;
  return true;
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%d%d", &p[i].first, &p[i].second);
  for (int i = 0; i < 4; i++) scanf("%d%d", &q[i].first, &q[i].second);
  sort(p, p + 4);
  sort(q, q + 4);
  bool ans = false;
  for (int i = 0; i < 4 && !ans; i++)
    if (chk(p[i], q[0], q[1]) && chk(p[i], q[1], q[3]) &&
        chk(p[i], q[3], q[2]) && chk(p[i], q[2], q[0]))
      ans = true;
  for (int i = 0; i < 4 && !ans; i++)
    if (chk(q[i], p[0], p[2]) && chk(q[i], p[2], p[3]) &&
        chk(q[i], p[3], p[1]) && chk(q[i], p[1], p[0]))
      ans = true;
  for (int i = 0; i < 4; i++) a[i] = pnt(p[i].first, p[i].second);
  for (int i = 0; i < 4; i++) b[i] = pnt(q[i].first, q[i].second);
  pair<pnt, pnt> seg_a[22], seg_b[22];
  seg_a[0] = make_pair(a[0], a[2]);
  seg_a[1] = make_pair(a[2], a[3]);
  seg_a[2] = make_pair(a[3], a[1]);
  seg_a[3] = make_pair(a[1], a[0]);
  seg_b[0] = make_pair(b[0], b[1]);
  seg_b[1] = make_pair(b[1], b[3]);
  seg_b[2] = make_pair(b[3], b[2]);
  seg_b[3] = make_pair(b[2], b[0]);
  for (int i = 0; i < 4 && !ans; i++)
    for (int j = 0; j < 4 && !ans; j++)
      if (chk_s(seg_a[i], seg_b[j])) ans = true;
  puts(ans ? "YES" : "NO");
  return 0;
}
