#include <bits/stdc++.h>
using namespace std;
int dist(int m, int n, int a, int b, int c) { return a * m + b * n + c; }
pair<int, int> p[4];
pair<int, pair<int, int> > line(int i, int j) {
  pair<int, pair<int, int> > x;
  x.first = p[i].second - p[j].second;
  x.second.first = p[j].first - p[i].first;
  x.second.second = p[j].second * p[i].first - p[i].second * p[j].first;
  return x;
}
int main() {
  int x1[4], y1[4];
  int a[4], b[4], c[4];
  for (int i = 0; i < 4; i++) cin >> x1[i] >> y1[i];
  for (int i = 0; i < 4; i++) cin >> p[i].first >> p[i].second;
  sort(x1, x1 + 4);
  sort(y1, y1 + 4);
  sort(p, p + 4);
  pair<int, pair<int, int> > calc = line(0, 2);
  a[0] = calc.first, b[0] = calc.second.first, c[0] = calc.second.second;
  calc = line(1, 3);
  a[1] = calc.first, b[1] = calc.second.first, c[1] = calc.second.second;
  calc = line(0, 1);
  a[2] = calc.first, b[2] = calc.second.first, c[2] = calc.second.second;
  calc = line(2, 3);
  a[3] = calc.first, b[3] = calc.second.first, c[3] = calc.second.second;
  int d1, d2, d3, d4;
  for (int i = -100; i <= 100; i++) {
    for (int j = -100; j <= 100; j++) {
      if (i <= x1[3] && i >= x1[0] && j <= y1[3] && j >= y1[0]) {
        d1 = dist(i, j, a[0], b[0], c[0]);
        d2 = dist(i, j, a[1], b[1], c[1]);
        d3 = dist(i, j, a[2], b[2], c[2]);
        d4 = dist(i, j, a[3], b[3], c[3]);
        if (d1 * d2 <= 0 && d3 * d4 <= 0) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
  cout << "NO";
}
