#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y;
};
struct square {
  point p[4];
};
square a, b;
double f(double a, double b, double t) { return a * t + b * (1 - t); }
int main() {
  for (int i = 0; i < 4; ++i) {
    cin >> a.p[i].x >> a.p[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> b.p[i].x >> b.p[i].y;
  }
  sort(a.p, a.p + 4, [](const point &a, const point &b) {
    if (a.y == b.y) {
      return a.x < b.x;
    } else {
      return a.y < b.y;
    }
  });
  sort(b.p, b.p + 4, [](const point &a, const point &b) {
    if (a.y == b.y) {
      return a.x < b.x;
    } else {
      return a.y < b.y;
    }
  });
  if (a.p[3].y < b.p[0].y || a.p[0].y > b.p[3].y || a.p[1].x < b.p[1].x ||
      a.p[0].x > b.p[2].x) {
    cout << "NO" << endl;
  } else if (a.p[3].y < f(b.p[0].y, b.p[1].y,
                          (a.p[3].x - b.p[1].x) / (b.p[0].x - b.p[1].x)) ||
             a.p[2].y < f(b.p[0].y, b.p[2].y,
                          (b.p[2].x - a.p[2].x) / (b.p[2].x - b.p[0].x)) ||
             a.p[1].y > f(b.p[1].y, b.p[3].y,
                          (b.p[3].x - a.p[1].x) / (b.p[3].x - b.p[1].x)) ||
             a.p[0].y > f(b.p[2].y, b.p[3].y,
                          (a.p[0].x - b.p[3].x) / (b.p[2].x - b.p[3].x))) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
