#include <bits/stdc++.h>
using namespace std;
long long int x[4], y[4], dx[4], dy[4], lx[4], ly[4], lc[4];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int i, j, minix = 300, miniy = 300, sz;
  for (i = 0; i < 4; i++) {
    cin >> x[i] >> y[i];
    minix = min(minix, x[i]);
    miniy = min(miniy, y[i]);
  }
  for (i = 0; i < 4; i++) cin >> dx[i] >> dy[i];
  for (i = 0; i < 4; i++) {
    x[i] -= minix;
    y[i] -= miniy;
    if (x[i] > 0) sz = x[i];
    dx[i] -= minix;
    dy[i] -= miniy;
  }
  for (i = 0; i < 4; i++) {
    lx[i] = dx[i] - dx[(i + 1) % 4];
    ly[i] = -dy[i] + dy[(i + 1) % 4];
    lc[i] = lx[i] * dy[i] + ly[i] * dx[i];
    lc[i] = -lc[i];
    if (lx[i] < 0) {
      lx[i] *= -1;
      ly[i] *= -1;
      lc[i] *= -1;
    }
  }
  for (i = 0; i <= sz; i++) {
    for (j = 0; j <= sz; j++) {
      if ((lx[0] * j + ly[0] * i + lc[0]) * (lx[2] * j + ly[2] * i + lc[2]) <=
              0 &&
          (lx[1] * j + ly[1] * i + lc[1]) * (lx[3] * j + ly[3] * i + lc[3]) <=
              0)
        break;
    }
    if (j != sz + 1) break;
  }
  if (i == sz + 1)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
