#include <bits/stdc++.h>
using namespace std;
const double EPS = 0.0000001;
struct point {
  double x;
  double y;
};
struct sq {
  double left;
  double right;
  double up;
  double down;
};
point get_point(double x, double y) {
  point tmp;
  tmp.x = x;
  tmp.y = y;
  return tmp;
}
double get_dis(point a, point b) {
  double x = a.x - b.x, y = a.y - b.y;
  return sqrt(x * x + y * y);
}
sq first, second;
double s_second;
vector<point> f(4), s(4);
double get_s(point a, point b, point c) {
  double p, aa, bb, cc;
  aa = get_dis(a, b);
  bb = get_dis(b, c);
  cc = get_dis(c, a);
  p = (aa + bb + cc) / 2.0;
  return sqrt(p * (p - aa) * (p - bb) * (p - cc));
}
bool check1(point a) {
  if (a.x >= first.left && a.x <= first.right && a.y <= first.up &&
      a.y >= first.down)
    return 1;
  return 0;
}
bool check2(point a) {
  if (a.x >= second.left && a.x <= second.right && a.y <= second.up &&
      a.y >= second.down) {
    double now_s = get_s(a, s[0], s[1]) + get_s(a, s[1], s[2]) +
                   get_s(a, s[2], s[3]) + get_s(a, s[3], s[0]);
    if (abs(now_s - s_second) > EPS) return 0;
    return 1;
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  for (int i = 0; i < 4; ++i) {
    cin >> f[i].x >> f[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> s[i].x >> s[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    first.left = (i == 0 ? f[i].x : min(first.left, f[i].x));
    first.right = (i == 0 ? f[i].x : max(first.right, f[i].x));
    first.up = (i == 0 ? f[i].y : max(first.up, f[i].y));
    first.down = (i == 0 ? f[i].y : min(first.down, f[i].y));
    second.left = (i == 0 ? s[i].x : min(second.left, s[i].x));
    second.right = (i == 0 ? s[i].x : max(second.right, s[i].x));
    second.up = (i == 0 ? s[i].y : max(second.up, s[i].y));
    second.down = (i == 0 ? s[i].y : min(second.down, s[i].y));
  }
  s_second = get_dis(s[1], s[0]) * get_dis(s[2], s[1]);
  for (int i = 0; i < 4; ++i) {
    if (check1(s[i]) || check2(f[i])) {
      cout << "YES";
      return 0;
    }
  }
  for (double x = max(first.left, second.left);
       x <= min(first.right, second.right); x += 0.01) {
    for (double y = max(first.down, second.down); y <= min(first.up, second.up);
         y += 0.01) {
      point now = get_point(x, y);
      if (check1(now) && check2(now)) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
