#include <bits/stdc++.h>
using namespace std;
bool f(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  bool in;
  int i;
  double a[5], b[5], x[5], y[5], aa[5], bb[5], xx[5], yy[5], xsr, ysr, amin,
      amax, bmin, bmax, xmin, xmax, ymin, ymax;
  double k, q;
  cin >> a[1] >> b[1] >> a[2] >> b[2] >> a[3] >> b[3] >> a[4] >> b[4];
  cin >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3] >> x[4] >> y[4];
  for (long long i = 1; i <= 4; i++) aa[i] = a[i];
  for (long long i = 1; i <= 4; i++) bb[i] = b[i];
  sort(aa + 1, aa + 5);
  sort(bb + 1, bb + 5);
  amin = aa[1];
  amax = aa[4];
  bmin = bb[1];
  bmax = bb[4];
  for (long long i = 1; i <= 4; i++) xx[i] = x[i];
  for (long long i = 1; i <= 4; i++) yy[i] = y[i];
  sort(xx + 1, xx + 5);
  sort(yy + 1, yy + 5);
  xmin = xx[1];
  xmax = xx[4];
  ymin = yy[1];
  ymax = yy[4];
  xsr = (xmin + xmax) / 2;
  ysr = (ymin + ymax) / 2;
  for (long long i = 1; i <= 4; i++)
    if (x[i] >= amin && x[i] <= amax && y[i] >= bmin && y[i] <= bmax) {
      cout << "YES";
      return 0;
    }
  if (xsr >= amin && xsr <= amax && ysr >= bmin && ysr <= bmax) {
    cout << "YES";
    return 0;
  }
  in = true;
  for (i = 2; i <= 4; i++) {
    k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    q = (y[i - 1] * x[i] - x[i - 1] * y[i]) / (x[i] - x[i - 1]);
    if ((b[1] - a[1] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  }
  k = (y[1] - y[4]) / (x[1] - x[4]);
  q = (y[4] * x[1] - x[4] * y[1]) / (x[1] - x[4]);
  if ((b[1] - a[1] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  if (in) {
    cout << "YES";
    return 0;
  }
  in = true;
  for (i = 2; i <= 4; i++) {
    k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    q = (y[i - 1] * x[i] - x[i - 1] * y[i]) / (x[i] - x[i - 1]);
    if ((b[2] - a[2] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  }
  k = (y[1] - y[4]) / (x[1] - x[4]);
  q = (y[4] * x[1] - x[4] * y[1]) / (x[1] - x[4]);
  if ((b[2] - a[2] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  if (in) {
    cout << "YES";
    return 0;
  }
  in = true;
  for (i = 2; i <= 4; i++) {
    k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    q = (y[i - 1] * x[i] - x[i - 1] * y[i]) / (x[i] - x[i - 1]);
    if ((b[3] - a[3] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  }
  k = (y[1] - y[4]) / (x[1] - x[4]);
  q = (y[4] * x[1] - x[4] * y[1]) / (x[1] - x[4]);
  if ((b[3] - a[3] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  if (in) {
    cout << "YES";
    return 0;
  }
  in = true;
  for (i = 2; i <= 4; i++) {
    k = (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    q = (y[i - 1] * x[i] - x[i - 1] * y[i]) / (x[i] - x[i - 1]);
    if ((b[4] - a[4] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  }
  k = (y[1] - y[4]) / (x[1] - x[4]);
  q = (y[4] * x[1] - x[4] * y[1]) / (x[1] - x[4]);
  if ((b[4] - a[4] * k - q) * (ysr - xsr * k - q) < 0) in = false;
  if (in) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
