#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const LL LLINF = 1e14;
const double pi = acos(-1.0);
double a[10][2], b[10][2];
double solve1(int x, int y, double i, double j) {
  return (a[y][0] - a[x][0]) * (j - a[x][1]) -
         (i - a[x][0]) * (a[y][1] - a[x][1]);
}
double solve2(int x, int y, double i, double j) {
  return (b[y][0] - b[x][0]) * (j - b[x][1]) -
         (i - b[x][0]) * (b[y][1] - b[x][1]);
}
bool check(int i, int j) {
  int flag = 0;
  if (solve1(1, 2, i, j) * solve1(3, 4, i, j) >= 0 &&
      solve1(2, 3, i, j) * solve1(4, 1, i, j) >= 0)
    flag++;
  if (solve2(1, 2, i, j) * solve2(3, 4, i, j) >= 0 &&
      solve2(2, 3, i, j) * solve2(4, 1, i, j) >= 0)
    flag++;
  if (flag == 2) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 1; i <= 4; i++) cin >> a[i][0] >> a[i][1];
  for (int i = 1; i <= 4; i++) cin >> b[i][0] >> b[i][1];
  int flag = 0;
  for (int i = -100; i <= 100; i++) {
    for (int j = -100; j <= 100; j++) {
      if (check((double)i, (double)j)) flag = 1;
    }
  }
  if (flag == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
