#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
struct Point {
  double x, y;
  Point(double u = 0.0, double v = 0.0) {
    x = u;
    y = v;
  }
  Point operator-(const Point &u) const { return Point(x - u.x, y - u.y); }
  double crs(const Point &u) { return x * u.y - y * u.x; }
} pa[15], pb[15], t[15];
bool inn(Point u, Point v[]) {
  for (int i = 1; i <= 4; i++) t[i] = v[i] - v[i - 1];
  for (int i = 1; i <= 4; i++)
    if (fabs(t[i].crs(u - v[i - 1])) < eps) {
      if (u.x < min(v[i - 1].x, v[i].x) || u.x > max(v[i - 1].x, v[i].x) ||
          u.y < min(v[i - 1].y, v[i].y) || u.y > max(v[i - 1].y, v[i].y))
        return false;
      else
        return true;
    }
  for (int i = 1; i <= 4; i++)
    if (t[i].crs(u - v[i - 1]) * t[1].crs(u - v[0]) < 0) return false;
  return true;
}
int main() {
  for (int i = 1; i <= 4; i++) scanf("%lf %lf", &pa[i].x, &pa[i].y);
  for (int i = 1; i <= 4; i++) scanf("%lf %lf", &pb[i].x, &pb[i].y);
  pa[0] = pa[4];
  pb[0] = pb[4];
  pa[5] = Point((pa[1].x + pa[3].x) / 2.0, (pa[1].y + pa[3].y) / 2.0);
  pb[5] = Point((pb[1].x + pb[3].x) / 2.0, (pb[1].y + pb[3].y) / 2.0);
  for (int i = 1; i <= 5; i++)
    if (inn(pa[i], pb) || inn(pb[i], pa)) {
      printf("YES\n");
      return 0;
    }
  printf("NO\n");
  return 0;
}
