#include <bits/stdc++.h>
using namespace std;
long double x[2][5], y[2][5], xmi[2], ymi[2], xma[2], yma[2];
long double area, allarea;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  for (long long i = 0; i < 2; i++) {
    for (long long j = 0; j < 4; j++) {
      cin >> x[i][j] >> y[i][j];
      if (!j) {
        xmi[i] = xma[i] = x[i][j];
        ymi[i] = yma[i] = y[i][j];
      } else {
        xmi[i] = min(xmi[i], x[i][j]);
        xma[i] = max(xma[i], x[i][j]);
        ymi[i] = min(ymi[i], y[i][j]);
        yma[i] = max(yma[i], y[i][j]);
      }
    }
    x[i][4] = (x[i][0] + x[i][2]) / 2;
    y[i][4] = (y[i][0] + y[i][2]) / 2;
  }
  allarea = abs((x[1][1] - x[1][0]) * (y[1][3] - y[1][0]) -
                (y[1][1] - y[1][0]) * (x[1][3] - x[1][0]));
  for (long long i = 0; i < 5; i++) {
    if (x[1][i] >= xmi[0] && x[1][i] <= xma[0] && y[1][i] >= ymi[0] &&
        y[1][i] <= yma[0]) {
      cout << "YES";
      return 0;
    }
    area = 0;
    for (long long j = 0; j < 4; j++)
      area += abs((x[1][j] - x[0][i]) * (y[1][(j + 1) % 4] - y[0][i]) -
                  (y[1][j] - y[0][i]) * (x[1][(j + 1) % 4] - x[0][i])) /
              2;
    if (area == allarea) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
