#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int x1, y1, x2, y2, x3, y3, x4, y4;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
  int x5, y5, x6, y6, x7, y7, x8, y8;
  cin >> x5 >> y5 >> x6 >> y6 >> x7 >> y7 >> x8 >> y8;
  int mx1 = min({x1, x2, x3, x4});
  int mx2 = max({x1, x2, x3, x4});
  int my1 = min({y1, y2, y3, y4});
  int my2 = max({y1, y2, y3, y4});
  set<pair<int, int>> pnts1;
  bool flag = false;
  for (int i = mx1; i <= mx2; i++) {
    for (int j = my1; j <= my2; j++) {
      pnts1.insert({i, j});
    }
  }
  int mx3 = min({x5, x6, x7, x8});
  int mx4 = max({x5, x6, x7, x8});
  int my3 = min({y5, y6, y7, y8});
  int my4 = max({y5, y6, y7, y8});
  int midy = (my3 + my4) / 2;
  set<pair<int, int>> pnts2;
  int mv = 0;
  for (int i = mx3; i <= mx3 + (mx4 - mx3) / 2; i++) {
    int cnt = mv;
    while (cnt <= abs(mv)) {
      if (pnts1.find({i, midy + cnt}) != pnts1.end()) {
        flag = true;
        break;
      }
      cnt++;
    }
    if (flag) {
      break;
    }
    mv--;
  }
  mv++;
  for (int i = mx3 + (mx4 - mx3) / 2; i <= mx4; i++) {
    int cnt = mv;
    while (cnt <= abs(mv)) {
      if (pnts1.find({i, midy + cnt}) != pnts1.end()) {
        flag = true;
        break;
      }
      cnt++;
    }
    if (flag) {
      break;
    }
    mv++;
  }
  if (flag) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}
