#include <bits/stdc++.h>
using namespace std;
long long int eq(long long int x1, long long int y1, long long int x2,
                 long long int y2, long long int x, long long int y) {
  if (((y - y1) * (x1 - x2)) - ((x - x1) * (y1 - y2)) > 0)
    return 1;
  else if (((y - y1) * (x1 - x2)) - ((x - x1) * (y1 - y2)) < 0)
    return -1;
  else
    return 0;
}
long long int le(long long int x1, long long int y1, long long int x2,
                 long long int y2) {
  return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
pair<long long int, long long int> ip(long long int x1, long long int y1,
                                      long long int x2, long long int y2,
                                      long long int p1, long long int q1,
                                      long long int p2, long long int q2) {
  long long int x, y;
  x = ((-(x1 * y2 - y1 * x2) * (p1 - p2) + (p1 * q2 - q1 * p2) * (x1 - x2)) /
       (((y1 - y2) * (p1 - p2)) - (q1 - q2) * (x1 - x2)));
  y = ((x * (q1 - q2) + (p1 * q2 - q1 * p2)) / (p1 - p2));
  return make_pair(x, y);
}
int main() {
  long long int x[4], y[4], p[4], q[4], ck1, ck2, i, j, l1, l2, lf, o = 0,
                                                                    z = 0;
  pair<long long int, long long int> r;
  vector<long long int> c;
  for (i = 0; i < 4; i++) cin >> x[i] >> y[i];
  for (i = 0; i < 4; i++) cin >> p[i] >> q[i];
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      ck1 = eq(x[i % 4], y[i % 4], x[(i + 1) % 4], y[(i + 1) % 4], p[j % 4],
               q[j % 4]);
      lf = le(x[i % 4], y[i % 4], x[(i + 1) % 4], y[(i + 1) % 4]);
      ck2 = eq(x[i % 4], y[i % 4], x[(i + 1) % 4], y[(i + 1) % 4],
               p[(j + 1) % 4], q[(j + 1) % 4]);
      if (ck1 == 1 || ck2 == 1) o++;
      if (ck1 == 0 || ck2 == 0) z++;
      if (ck1 != ck2) {
        c.push_back(ck1);
        c.push_back(ck2);
        r = ip(x[i % 4], y[i % 4], x[(i + 1) % 4], y[(i + 1) % 4], p[j % 4],
               q[j % 4], p[(j + 1) % 4], q[(j + 1) % 4]);
        l1 = le(x[i % 4], y[i % 4], r.first, r.second);
        l2 = le(x[(i + 1) % 4], y[(i + 1) % 4], r.first, r.second);
        if (l1 + l2 == lf) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
  if ((c.size() == 0 && (o == 0 || o == 32) && !z) ||
      (c.size() == 16 && (o == 8 || o == 24) && !z)) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
