#include <bits/stdc++.h>
using namespace std;
bool lies_between_lines(long long coord1[3], long long coord2[3],
                        long long coord3[3], long long coord4[3],
                        long long pnt[3]) {
  long long d1, d2, i, j;
  d1 = (pnt[1] - coord1[1]) * (coord2[2] - coord1[2]) -
       (pnt[2] - coord1[2]) * (coord2[1] - coord1[1]);
  d2 = (pnt[1] - coord3[1]) * (coord4[2] - coord3[2]) -
       (pnt[2] - coord3[2]) * (coord4[1] - coord3[1]);
  if (d1 * d2 <= 0) return true;
  return false;
}
void check(long long a[5][3], long long b[5][3]) {
  long long center[3];
  center[1] = (a[1][1] + a[2][1] + a[3][1] + a[4][1]) / 4,
  center[2] = (a[1][2] + a[2][2] + a[3][2] + a[4][2]) / 4;
  if (lies_between_lines(b[1], b[2], b[4], b[3], center) &&
      lies_between_lines(b[1], b[4], b[2], b[3], center)) {
    cout << "YES";
    exit(0);
  }
  for (long long i = 1; i <= 4; ++i) {
    if (lies_between_lines(b[1], b[2], b[4], b[3], a[i]) &&
        lies_between_lines(b[1], b[4], b[2], b[3], a[i])) {
      cout << "YES";
      exit(0);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, a[5][3], b[5][3];
  for (i = 1; i <= 4; ++i) {
    for (j = 1; j <= 2; ++j) cin >> a[i][j];
  }
  for (i = 1; i <= 4; ++i) {
    for (j = 1; j <= 2; ++j) cin >> b[i][j];
  }
  check(a, b);
  check(b, a);
  cout << "NO";
  return 0;
}
