#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double x1[8], x2[8];
  for (int i = 0; i < 8; i++) {
    cin >> x1[i];
  }
  for (int i = 0; i < 8; i++) {
    cin >> x2[i];
  }
  bool ans = false;
  double x[4], y[4];
  for (int i = 0; i < 4; i++) {
    x[i] = x1[i * 2];
  }
  for (int i = 0; i < 4; i++) {
    y[i] = x1[2 * i + 1];
  }
  sort(x, x + 4);
  sort(y, y + 4);
  double xc1, yc1;
  for (int i = 0; i < 4; i++) {
    double minx = x[0];
    double maxx = x[3];
    double miny = y[0];
    double maxy = y[3];
    xc1 = (maxx + minx) / 2;
    yc1 = (maxy + miny) / 2;
    if (x2[2 * i] <= maxx && x2[2 * i] >= minx && x2[2 * i + 1] <= maxy &&
        x2[2 * i + 1] >= miny) {
      ans = true;
      break;
    }
  }
  double xx, yy;
  xx = xc1;
  yy = yc1;
  xc1 = xx * sqrt(0.5) + yy * sqrt(0.5);
  yc1 = yy * sqrt(0.5) - xx * sqrt(0.5);
  for (int i = 0; i < 4; i++) {
    double x = x1[2 * i];
    double y = x1[2 * i + 1];
    x1[2 * i] = x * sqrt(0.5) + y * sqrt(0.5);
    x1[2 * i + 1] = y * sqrt(0.5) - x * sqrt(0.5);
  }
  for (int i = 0; i < 4; i++) {
    double x = x2[2 * i];
    double y = x2[2 * i + 1];
    x2[2 * i] = x * sqrt(0.5) + y * sqrt(0.5);
    x2[2 * i + 1] = y * sqrt(0.5) - x * sqrt(0.5);
  }
  for (int i = 0; i < 4; i++) {
    x[i] = x2[i * 2];
  }
  for (int i = 0; i < 4; i++) {
    y[i] = x2[2 * i + 1];
  }
  sort(x, x + 4);
  sort(y, y + 4);
  for (int i = 0; i < 4; i++) {
    double minx = x[0];
    double maxx = x[3];
    double miny = y[0];
    double maxy = y[3];
    if (x1[2 * i] <= maxx && x1[2 * i] >= minx && x1[2 * i + 1] <= maxy &&
        x1[2 * i + 1] >= miny) {
      ans = true;
      break;
    }
  }
  if (xc1 <= x[3] && xc1 >= x[0] && yc1 <= y[3] && yc1 >= y[0]) {
    ans = true;
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
