#include <bits/stdc++.h>
using namespace std;
int n;
pair<double, double> a[6], b[6], t;
double f, g;
double dist(pair<double, double> A, pair<double, double> B) {
  return (A.first - B.first) * (A.first - B.first) +
         (A.second - B.second) * (A.second - B.second);
}
double det(pair<double, double> A, pair<double, double> B,
           pair<double, double> C) {
  return A.first * B.second + B.first * C.second + C.first * A.second -
         B.second * C.first - C.second * A.first - A.second * B.first;
}
int vf(pair<double, double> t, pair<double, double> a[6]) {
  f = dist(a[1], a[2]);
  g = 0;
  for (int i = 1; i <= 4; i++) g += abs(det(t, a[i], a[i + 1]));
  g /= 2;
  if (abs(g - f) < 1e-8) return 1;
  return 0;
}
int intersectie(pair<double, double> A, pair<double, double> B,
                pair<double, double> C, pair<double, double> D) {
  cout << det(A, C, D) << ' ' << det(C, D, B) << '\n';
  if (det(A, C, D) * det(B, C, D) > 0) return 1;
  return 0;
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  for (int i = 1; i <= 4; i++) cin >> a[i].first >> a[i].second;
  a[5] = a[1];
  for (int i = 1; i <= 4; i++) cin >> b[i].first >> b[i].second;
  b[5] = b[1];
  for (int i = 1; i <= 4; i++)
    if (vf(a[i], b)) {
      cout << "YES";
      return 0;
    }
  for (int i = 1; i <= 4; i++)
    if (vf(b[i], a)) {
      cout << "YES";
      return 0;
    }
  for (int i = 1; i <= 4; i++) {
    t.first = (a[i].first + a[i + 1].first) / 2;
    t.second = (a[i].second + a[i + 1].second) / 2;
    if (vf(t, b)) {
      cout << "YES";
      return 0;
    }
  }
  for (int i = 1; i <= 4; i++) {
    t.first = (b[i].first + b[i + 1].first) / 2;
    t.second = (b[i].second + b[i + 1].second) / 2;
    if (vf(t, a)) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
