#include <bits/stdc++.h>
using namespace std;
double infinite = 1e18;
long long i, j;
double give_slop(long long x1, long long y1, long long x2, long long y2) {
  double slop;
  if (x1 == x2) {
    slop = infinite;
  } else {
    slop = ((y2 - y1 + 0.00) / (x2 - x1));
  }
  return slop;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long x1[10], y1[10], x2[10], y2[10];
  for (i = 0; i < 4; i++) cin >> x1[i] >> y1[i];
  for (i = 0; i < 4; i++) cin >> x2[i] >> y2[i];
  x2[4] = x2[0];
  y2[4] = y2[0];
  double xmid1, ymid1, xmid2, ymid2;
  for (i = 0; i < 4; i++) {
    xmid1 += x1[i];
    ymid1 += y1[i];
    xmid2 += x2[i];
    ymid2 += y2[i];
  }
  xmid1 = (xmid1 + 0.00) / 4;
  ymid1 = (ymid1 + 0.00) / 4;
  xmid2 = (xmid2 + 0.00) / 4;
  ymid2 = (ymid2 + 0.00) / 4;
  x1[4] = xmid1;
  y1[4] = ymid1;
  for (i = 0; i <= 4; i++) {
    long long x = x1[i], y = y1[i], c = 0;
    for (j = 0; j < 4; j++) {
      double m = give_slop(x2[j], y2[j], x2[j + 1], y2[j + 1]);
      if (m == infinite) {
        double temp1, temp2;
        temp1 = x1[i] - x2[j];
        temp2 = xmid2 - x2[j];
        if ((temp1 * temp2) < 0) {
          c = 1;
          break;
        }
      } else {
        double temp1, temp2;
        temp1 = (m * (x1[i] - x2[j])) - (y1[i] - y2[j]);
        temp2 = (m * (xmid2 - x2[j])) - (ymid2 - y2[j]);
        if ((temp1 * temp2) < 0) {
          c = 1;
          break;
        }
      }
    }
    if (c == 0) {
      cout << "YES";
      return 0;
    }
  }
  x1[4] = x1[0];
  y1[4] = y1[0];
  x2[4] = xmid2;
  y2[4] = ymid2;
  for (i = 0; i <= 4; i++) {
    long long x = x2[i], y = y2[i], c = 0;
    for (j = 0; j < 4; j++) {
      double m = give_slop(x1[j], y1[j], x1[j + 1], y1[j + 1]);
      if (m == infinite) {
        double temp1, temp2;
        temp1 = x2[i] - x1[j];
        temp2 = xmid1 - x1[j];
        if ((temp1 * temp2) < 0) {
          c = 1;
          break;
        }
      } else {
        double temp1, temp2;
        temp1 = (m * (x2[i] - x1[j])) - (y2[i] - y1[j]);
        temp2 = (m * (xmid1 - x1[j])) - (ymid1 - y1[j]);
        if ((temp1 * temp2) < 0) {
          c = 1;
          break;
        }
      }
    }
    if (c == 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
