#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
using llong = long long;
using ld = long double;
using itn = int;
using ii = pair<int, int>;
using ull = unsigned long long;
using psi = pair<string, int>;
using ll = pair<llong, llong>;
const llong over999 = 1e9;
const ld over999ld = 1e18 + 1;
const llong md = 1e9 + 7;
const ld EPS = 1e-2;
const ld Pi = acos(-1);
const ld nich = 0;
const llong mnogo = 300;
ii a[10], b[10];
int mx_x = -1000, mx_y = -1000, mn_x = 1000, mn_y = 1000;
bool check(ii a) {
  return (a.first >= mn_x && a.first <= mx_x && a.second >= mn_y &&
          a.second <= mx_y);
}
inline int area(ii a, ii b, ii c) {
  return (b.first - a.first) * (c.second - a.second) -
         (b.second - a.second) * (c.first - a.first);
}
inline bool intersect_1(int a, int b, int c, int d) {
  if (a > b) swap(a, b);
  if (c > d) swap(c, d);
  return max(a, c) <= min(b, d);
}
bool intersect(ii a, ii b, ii c, ii d) {
  return intersect_1(a.first, b.first, c.first, d.first) &&
         intersect_1(a.second, b.second, c.second, d.second) &&
         area(a, b, c) * area(a, b, d) <= 0 &&
         area(c, d, a) * area(c, d, b) <= 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  for (int i = 1; i <= 4; ++i) {
    cin >> a[i].first >> a[i].second;
    mn_x = min(mn_x, a[i].first);
    mx_x = max(mx_x, a[i].first);
    mn_y = min(mn_y, a[i].second);
    mx_y = max(mx_y, a[i].second);
  }
  for (int j = 1; j <= 4; ++j) {
    cin >> b[j].first >> b[j].second;
    if (check(b[j])) return cout << "YES", 0;
  }
  mx_x = -1000, mx_y = -1000, mn_x = 1000, mn_y = 1000;
  for (int i = 1; i <= 4; ++i) {
    mn_x = min(mn_x, b[i].first);
    mx_x = max(mx_x, b[i].first);
    mn_y = min(mn_y, b[i].second);
    mx_y = max(mx_y, b[i].second);
  }
  a[5] = a[1];
  b[5] = b[1];
  for (int j = 1; j <= 4; ++j) {
    if (intersect(a[j], a[j + 1], {mn_x, (mn_y + mx_y) / 2},
                  {mx_x, (mn_y + mx_y) / 2}))
      return cout << "YES", 0;
    if (intersect(a[j], a[j + 1], {(mx_x + mn_x) / 2, mn_y},
                  {(mx_x + mn_x) / 2, mx_y}))
      return cout << "YES", 0;
  }
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= 4; j++) {
      if (intersect(a[i], a[i + 1], b[j], b[j + 1])) return cout << "YES", 0;
    }
  }
  cout << "NO";
  return 0;
}
