#include <bits/stdc++.h>
using namespace std;
long long int minx1 = 1e12, maxx1 = -1e12, miny1 = 1e12, maxy1 = -1e12,
              minx2 = 1e12, maxx2 = -1e12, miny2 = 1e12, maxy2 = -1e12;
vector<pair<long long int, long long int> > v;
pair<long double, long double> c;
bool check1(long long int x, long long int y) {
  if (x <= maxx1 && x >= minx1 && y <= maxy1 && y >= miny1) return true;
  return false;
}
bool check2(long long int x, long long int y) {
  long long int m[5];
  m[0] = (v[1].second - v[0].second) / (v[1].first - v[0].first);
  m[1] = (v[2].second - v[1].second) / (v[2].first - v[1].first);
  m[2] = (v[3].second - v[2].second) / (v[3].first - v[2].first);
  m[3] = (v[0].second - v[3].second) / (v[0].first - v[3].first);
  for (int i = 0; i < 4; i++) {
    long double z = m[i];
    long double f1 = v[i].first;
    long double f2 = v[i].second;
    long double q = (c.second - f2) - (z * (c.first - f1));
    long double p = (y - f2) - (z * (x - f1));
    if (p * q < 0) return false;
  }
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int a, b;
  for (int i = 0; i < 4; i++) {
    cin >> a >> b;
    minx1 = min(minx1, a);
    maxx1 = max(maxx1, a);
    miny1 = min(miny1, b);
    maxy1 = max(maxy1, b);
  }
  for (int i = 0; i < 4; i++) {
    cin >> a >> b;
    v.push_back(make_pair(a, b));
    minx2 = min(minx2, a);
    maxx2 = max(maxx2, a);
    miny2 = min(miny2, b);
    maxy2 = max(maxy2, b);
  }
  long double f = (v[0].first + v[1].first + v[2].first + v[3].first);
  long double k = (v[0].second + v[1].second + v[2].second + v[3].second);
  c = make_pair(f / 4.00, k / 4.00);
  for (int i = -100; i <= 100; i++)
    for (int j = -100; j <= 100; j++) {
      long long int x = i, y = j;
      if (check1(x, y) && check2(x, y)) {
        cout << "YES" << endl;
        return 0;
      }
    }
  cout << "NO" << endl;
  return 0;
}
