#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 3;
struct pt {
  int x, y;
  pt(int x = 0, int y = 0) : x(x), y(y) {}
  pt operator+(const pt& p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
  pt operator*(int d) const { return pt(x * d, y * d); }
  int operator%(const pt& p) const { return x * p.y - y * p.x; }
  int operator*(const pt& p) const { return x * p.x + y * p.y; }
  int norm2() const { return x * x + y * y; }
};
int cls(pt a, pt b, pt c) {
  int ret = (b - a) % (c - a);
  if (ret > 0) return 1;
  if (ret < 0) return -1;
  return 0;
}
bool bbox(int l1, int r1, int l2, int r2) {
  if (l1 > r1) swap(l1, r1);
  if (l2 > r2) swap(l2, r2);
  return !(r1 < l2 || r2 < l1);
}
bool inter(pt a, pt b, pt c, pt d) {
  return bbox(a.x, b.x, c.x, d.x) && bbox(a.y, b.y, c.y, d.y) &&
         cls(a, b, c) * cls(a, b, d) <= 0 && cls(c, d, a) * cls(c, d, b) <= 0;
}
pt read() {
  int x, y;
  cin >> x >> y;
  return pt(x, y);
}
const int OO = 1e9;
bool check(vector<pt> A, vector<pt> B) {
  bool was = false;
  for (int(i) = (0); (i) < (4); (i)++) {
    for (int(j) = (0); (j) < (4); (j)++) {
      if (inter(A[i], A[(i + 1) % 4], B[j], B[(j + 1) % 4])) {
        was = true;
      }
    }
  }
  if (was) {
    return true;
  }
  int xMin = OO;
  int xMax = -OO;
  int yMin = OO;
  int yMax = -OO;
  for (int(i) = (0); (i) < (4); (i)++) {
    for (int(j) = (0); (j) < (4); (j)++) {
      xMin = min(xMin, A[i].x);
      xMax = max(xMax, A[i].x);
      yMin = min(yMin, A[i].y);
      yMax = max(yMax, A[i].y);
    }
  }
  was = false;
  for (int(i) = (0); (i) < (4); (i)++) {
    if (B[i].x < xMin || B[i].x > xMax || B[i].y < yMin || B[i].y > yMax) {
      return false;
    }
  }
  return true;
}
pt transform(pt a) {
  pt v1 = pt(-1, 1);
  pt v2 = pt(1, 1);
  return pt(v1 * a, v2 * a);
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  vector<pt> A;
  vector<pt> B;
  for (int(i) = (0); (i) < (4); (i)++) {
    pt tmp = read();
    A.push_back(tmp);
  }
  for (int(i) = (0); (i) < (4); (i)++) {
    pt tmp = read();
    B.push_back(tmp);
  }
  if (check(A, B)) {
    cout << "YES" << endl;
    return 0;
  }
  for (int(i) = (0); (i) < (4); (i)++) {
    A[i] = transform(A[i]);
    B[i] = transform(B[i]);
  }
  if (check(B, A)) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
