#include <bits/stdc++.h>
using namespace std;
struct {
  int x, y;
} A[10], B[10];
int main() {
  int x, y, i, ok = 0;
  for (i = 0; i < 4; i++) {
    scanf("%d %d", &A[i].x, &A[i].y);
  }
  A[4].x = (A[0].x + A[2].x) / 2;
  A[4].y = (A[0].y + A[2].y) / 2;
  for (i = 0; i < 4; i++) {
    scanf("%d %d", &B[i].x, &B[i].y);
  }
  if (B[0].y == B[2].y) {
    B[4].y = B[0].y;
    B[4].x = B[1].x;
  } else {
    B[4].y = B[1].y;
    B[4].x = B[0].x;
  }
  for (i = 0; i < 5; i++) {
    if (B[i].x >= min(A[0].x, A[2].x) && B[i].x <= max(A[0].x, A[2].x)) {
      if (B[i].y >= min(A[0].y, A[2].y) && B[i].y <= max(A[0].y, A[2].y))
        ok = 1;
    }
  }
  for (i = 0; i < 5; i++) {
    if (A[i].x - A[i].y >= min(B[0].x - B[0].y, B[2].x - B[2].y) &&
            A[i].x - A[i].y <= max(B[0].x - B[0].y, B[2].x - B[2].y) ||
        A[i].x - A[i].y >= min(B[1].x - B[1].y, B[3].x - B[3].y) &&
            A[i].x - A[i].y <= max(B[1].x - B[1].y, B[3].x - B[3].y)) {
      if (A[i].x + A[i].y >= min(B[0].x + B[0].y, B[2].x + B[2].y) &&
              A[i].x + A[i].y <= max(B[0].x + B[0].y, B[2].x + B[2].y) ||
          A[i].x + A[i].y >= min(B[1].x + B[1].y, B[3].x + B[3].y) &&
              A[i].x + A[i].y <= max(B[1].x + B[1].y, B[3].x + B[3].y))
        ok = 1;
    }
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
