#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
void OFAST() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
}
pair<int, int> a[5], b[5];
int dt(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int x1 = b.first - a.first, y1 = b.second - a.second, x2 = c.first - b.first,
      y2 = c.second - b.second;
  return abs(x1 * y2 - x2 * y1);
}
bool in(pair<int, int> u, pair<int, int> e[]) {
  int s = dt(e[0], e[1], e[2]) + dt(e[0], e[3], e[2]);
  s -= dt(e[0], e[1], u);
  s -= dt(e[1], e[2], u);
  s -= dt(e[2], e[3], u);
  s -= dt(e[3], e[0], u);
  return s == 0;
}
int main() {
  OFAST();
  for (int i = (0), _b = (4); i < _b; ++i) cin >> a[i].first >> a[i].second;
  for (int i = (0), _b = (4); i < _b; ++i) cin >> b[i].first >> b[i].second;
  a[4].first = (a[0].first + a[1].first + a[2].first + a[3].first) / 4;
  a[4].second = (a[0].second + a[1].second + a[2].second + a[3].second) / 4;
  b[4].first = (b[0].first + b[1].first + b[2].first + b[3].first) / 4;
  b[4].second = (b[0].second + b[1].second + b[2].second + b[3].second) / 4;
  for (int j = (0), _b = (5); j < _b; ++j) {
    if (in(b[j], a)) {
      cout << "YES";
      return 0;
    }
    if (in(a[j], b)) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
