#include <bits/stdc++.h>
using namespace std;
class point {
 public:
  long long x, y;
  point() {
    x = 0;
    y = 0;
  }
};
long long orientation(point p, point q, point r) {
  long long val = (p.y - q.y) * (q.x - r.x) - (p.x - q.x) * (q.y - r.y);
  if (val == 0) return 0;
  if (val < 0) return 1;
  return 2;
}
bool on(point a, point b, point c) {
  return (b.x <= max(a.x, c.x) && b.x >= min(a.x, c.x) &&
          b.y <= max(a.y, c.y) && b.y >= min(a.y, c.y));
}
bool same(point a, point b) { return a.x == b.x && a.y == b.y; }
bool check(vector<point> a, point p) {
  long long i, j;
  vector<long long> tmp(4);
  bool fl = 0;
  for (i = 0; i < 4; i++) {
    tmp[i] = orientation(a[i % 4], a[(i + 1) % 4], p);
    if (tmp[i] == 0 && on(a[i % 4], p, a[(i + 1) % 4])) fl |= 1;
    fl |= same(a[i], p);
  }
  if (fl) return 1;
  if (tmp[0] == tmp[1] && tmp[1] == tmp[2] && tmp[2] == tmp[3] &&
      tmp[3] == tmp[0])
    return 1;
  return 0;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  vector<point> a(4), b(4);
  long long i, j;
  for (i = 0; i < 4; i++) cin >> a[i].x >> a[i].y;
  for (i = 0; i < 4; i++) cin >> b[i].x >> b[i].y;
  bool ans = 0;
  for (i = 0; i < 4; i++) ans |= check(a, b[i]);
  for (i = 0; i < 4; i++) ans |= check(b, a[i]);
  point c1, c2;
  for (i = 0; i < 4; i++) {
    c1.x += a[i].x;
    c1.y += a[i].y;
    c2.x += b[i].x;
    c2.y += b[i].y;
  }
  c1.x /= 4;
  c1.y /= 4;
  c2.x /= 4;
  c2.y /= 4;
  if (ans || check(a, c2) || check(b, c1))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
