#include <bits/stdc++.h>
using namespace std;
int a[11];
int b[11];
int a_x0, a_x1, a_y0, a_y1;
int b_x0, b_x1, b_y0, b_y1;
int min(int a, int b, int c, int d) { return min(min(a, b), min(c, d)); }
int max(int a, int b, int c, int d) { return max(max(a, b), max(c, d)); }
bool check() {
  for (int i = b_x0; i <= (b_x0 + b_x1) / 2; ++i) {
    int j = (b_y0 + b_y1) / 2 - (i - b_x0);
    for (int k = 1; k <= (b_x1 - b_x0) / 2 + 1; ++k) {
      int x = i + k - 1;
      int y = j + k - 1;
      if (a_x0 <= x && x <= a_x1 && a_y0 <= y && y <= a_y1) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  for (int i = 1; i <= 8; ++i) scanf("%d", &a[i]);
  a_x0 = min(a[1], a[3], a[5], a[7]);
  a_x1 = max(a[1], a[3], a[5], a[7]);
  a_y0 = min(a[2], a[4], a[6], a[8]);
  a_y1 = max(a[2], a[4], a[6], a[8]);
  for (int i = 1; i <= 8; ++i) scanf("%d", &b[i]);
  b_x0 = min(b[1], b[3], b[5], b[7]);
  b_x1 = max(b[1], b[3], b[5], b[7]);
  b_y0 = min(b[2], b[4], b[6], b[8]);
  b_y1 = max(b[2], b[4], b[6], b[8]);
  puts(check() ? "YES" : "NO");
  return 0;
}
