#include <bits/stdc++.h>
using namespace std;
long long t, n, x, y, z, d, a[1000005], b[1000005], c[1000005],
    minn = LONG_LONG_MAX, maxx = -LONG_MAX;
map<long long, long long> m1;
map<long long, long long> m2;
string s, s1, s2;
char cc;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  for (int i = 0; i < 8; i++) {
    cin >> a[i];
    cin >> b[i];
    if (i >= 4) {
      m1[a[i]]++;
      if (m1[a[i]] >= 2) {
        x = a[i];
      }
      m2[b[i]]++;
      if (m2[b[i]] >= 2) {
        y = b[i];
      }
    }
  }
  d = 0;
  if (a[0] == a[1]) {
    for (long long j = min(b[0], b[2]); j <= max(b[0], b[2]); j++) {
      for (long long i = min(a[0], a[2]); i <= max(a[0], a[2]); i++) {
        if (abs(i - x) + abs(j - y) <= abs(a[4] - x) + abs(b[4] - y)) {
          d = 1;
        }
      }
    }
  } else {
    a[8] = a[0];
    b[8] = b[0];
    for (int i = 0; i < 3; i++) {
      a[i] = a[i + 1];
      b[i] = b[i + 1];
    }
    b[3] = b[8];
    a[3] = a[8];
    for (long long j = min(b[0], b[2]); j <= max(b[0], b[2]); j++) {
      for (long long i = min(a[0], a[2]); i <= max(a[0], a[2]); i++) {
        if (abs(i - x) + abs(j - y) <= abs(a[4] - x) + abs(b[4] - y)) {
          d = 1;
        }
      }
    }
  }
  if (d) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
