#include <bits/stdc++.h>
using namespace std;
double area(int x1, int y1, int x2, int y2, int x3, int y3) {
  return abs((double)(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
bool check(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4,
           int x, int y) {
  double A = area(x1, y1, x2, y2, x3, y3) + area(x1, y1, x4, y4, x3, y3);
  double A1 = area(x, y, x1, y1, x2, y2);
  double A2 = area(x, y, x2, y2, x3, y3);
  double A3 = area(x, y, x3, y3, x4, y4);
  double A4 = area(x, y, x1, y1, x4, y4);
  return (A == A1 + A2 + A3 + A4);
}
int main() {
  int a[8], b[8];
  for (int i = 0; i < 8; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < 8; i++) {
    cin >> b[i];
  }
  bool res = false;
  for (int i = 0; i < 8; i += 2) {
    res = res |
          check(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], b[i], b[i + 1]);
  }
  for (int i = 0; i < 8; i += 2) {
    res = res |
          check(b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], a[i], a[i + 1]);
  }
  int cp1x = (a[0] + a[4]) / 2, cp1y = (a[1] + a[5]) / 2,
      cp2x = (b[0] + b[4]) / 2, cp2y = (b[1] + b[5]) / 2;
  res = res | check(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], cp2x, cp2y);
  res = res | check(b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], cp1x, cp1y);
  if (res)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
