#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int M = 1e9 + 7;
int sq[2][4][3];
int tmp[3];
void form(int x1, int y1, int x2, int y2) {
  tmp[0] = y1 - y2;
  tmp[1] = -(x1 - x2);
  tmp[2] = -x1 * (y1 - y2) + y1 * (x1 - x2);
}
bool in_bet(int x, int y) {
  bool flag = true;
  for (int k = 0; k < 2; k++) {
    for (int i = 0; i < 2; i++) {
      int a, b;
      a = x * sq[k][i][0] + y * sq[k][i][1] + sq[k][i][2];
      b = x * sq[k][i + 2][0] + y * sq[k][i + 2][1] + sq[k][i + 2][2];
      flag = flag && (a * b >= 0);
    }
  }
  return flag;
}
int main() {
  ios_base::sync_with_stdio(0);
  int points[4][2];
  for (int k = 0; k < 2; k++) {
    for (int i = 0; i < 4; i++) {
      int a, b;
      cin >> a >> b;
      points[i][0] = a, points[i][1] = b;
    }
    for (int i = 0; i < 4; i++) {
      form(points[i][0], points[i][1], points[(i + 1) % 4][0],
           points[(i + 1) % 4][1]);
      sq[k][i][0] = tmp[0], sq[k][i][1] = tmp[1], sq[k][i][2] = tmp[2];
    }
  }
  bool f = false;
  for (int x = -150; x <= 150; x++) {
    if (f) break;
    for (int y = -150; y <= 150; y++) {
      if (in_bet(x, y)) {
        f = true;
        break;
      }
    }
  }
  if (f)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
