#include <bits/stdc++.h>
using namespace std;
void read(int& sum) {
  sum = 0;
  char c = getchar();
  bool f = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  if (f) sum = -sum;
}
void read(long long& sum) {
  sum = 0;
  char c = getchar();
  bool f = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  if (f) sum = -sum;
}
void readvec(vector<int>& a, int n) {
  for (int i = 0; i < n; i++) read(a[i]);
}
void readvec(vector<long long>& a, long long n) {
  for (int i = 0; i < n; i++) read(a[i]);
}
const int MOD = 1e9 + 7;
const int INF = (int)2e9 + 7;
const long long LINF = (long long)1e18;
const long double PI = 3.1415926535897932384626433832795;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct P {
  long long x, y;
  void read_point() { read(x), read(y); }
  P operator-(const P& b) const { return P{x - b.x, y - b.y}; }
  void operator-=(const P& b) {
    x -= b.x;
    y -= b.y;
  }
  long long operator*(const P& b) const {
    return (long long)x * b.y - (long long)y * b.x;
  }
  long long triangle(const P& b, const P& c) const {
    return (b - *this) * (c - *this);
  }
  long long norm() const { return x * x + y * y; }
  bool operator<(const P& b) const {
    if (*this * b == 0) {
      return norm() < b.norm();
    }
    return *this * b < 0;
  }
};
bool intersect(P p1, P p2, P p3, P p4) {
  if ((p3 - p4) * (p2 - p1) == 0) {
    if (p1.triangle(p2, p3) != 0) {
      return false;
    }
    for (int i = 0; i < 2; i++) {
      if ((max(p1.x, p2.x) < min(p3.x, p4.x)) ||
          (max(p1.y, p2.y) < min(p3.y, p4.y))) {
        return false;
      }
      swap(p1, p3), swap(p2, p4);
    }
    return true;
  }
  for (int i = 0; i < 2; i++) {
    if (p1.triangle(p2, p3) < 0 && p1.triangle(p2, p4) < 0) {
      return false;
    } else if (p1.triangle(p2, p3) > 0 && p1.triangle(p2, p4) > 0) {
      return false;
    }
    swap(p1, p3), swap(p2, p4);
  }
  return true;
}
void solve() {
  int n;
  P a[4], b[4];
  for (int i = 0; i < 4; i++) {
    a[i].read_point();
  }
  for (int i = 0; i < 4; i++) {
    b[i].read_point();
  }
  long long mn_x = 1000, mx_x = -1000, mn_y = 1000, mx_y = -1000;
  for (int i = 0; i < 4; i++) {
    mn_x = min(mn_x, a[i].x);
    mx_x = max(mx_x, a[i].x);
    mn_y = min(mn_y, a[i].y);
    mx_y = max(mx_y, a[i].y);
  }
  for (int i = 0; i < 4; i++) {
    if (b[i].x >= mn_x && b[i].x <= mx_x && b[i].y <= mx_y && b[i].y >= mn_y) {
      cout << "YES\n";
      return;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      for (int k = 0; k < 4; k++) {
        for (int l = 0; l < 4; l++) {
          if (k == l) continue;
          if (intersect(a[i], a[j], b[k], b[l])) {
            cout << "YES\n";
            return;
          }
        }
      }
    }
  }
  cout << "NO\n";
}
int32_t main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
