#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
double calculate(int x1, int y1, int x2, int y2, int x3, int y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
double cacu(int x1, int y1, point a[]) {
  double sum = 0;
  int next;
  for (int i = 0; i < 4; i++) {
    next = (i + 1) % 4;
    sum += calculate(x1, y1, a[i].x, a[i].y, a[next].x, a[next].y);
  }
  return sum;
}
point a[4], b[4];
point mid1, mid2;
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> a[i].x >> a[i].y;
    a[i].x = (a[i].x) * 2;
    a[i].y = (a[i].y) * 2;
    if (i == 0) {
      mid1.x = 0;
      mid1.y = 0;
    }
    mid1.x += a[i].x;
    mid1.y += a[i].y;
  }
  for (int i = 0; i < 4; i++) {
    cin >> b[i].x >> b[i].y;
    b[i].x = (b[i].x) * 2;
    b[i].y = (b[i].y) * 2;
    if (i == 0) {
      mid2.x = 0;
      mid2.y = 0;
    }
    mid2.x += b[i].x;
    mid2.y += b[i].y;
  }
  mid1.x /= 4;
  mid1.y /= 4;
  mid2.x /= 4;
  mid2.y /= 4;
  double first, second;
  second = calculate(b[0].x, b[0].y, b[1].x, b[1].y, b[2].x, b[2].y);
  second *= 2;
  first = calculate(a[0].x, a[0].y, a[1].x, a[1].y, a[2].x, a[2].y);
  first *= 2;
  double sum, sum2;
  bool flag = false;
  for (int i = 0; i < 4; i++) {
    sum = cacu(a[i].x, a[i].y, b);
    if (sum == second) flag = true;
  }
  for (int i = 0; i < 4; i++) {
    sum = cacu(b[i].x, b[i].y, a);
    if (sum == first) flag = true;
  }
  sum = cacu(mid1.x, mid1.y, b);
  if (sum == second) flag = true;
  sum = cacu(mid2.x, mid2.y, a);
  if (sum == first) flag = true;
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
