#include <bits/stdc++.h>
using namespace std;
const int maxn = 210;
int mat[maxn][maxn];
int cross(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  pair<int, int> v1 = {b.first - a.first, b.second - a.second},
                 v2 = {c.first - b.first, c.second - b.second};
  int prod = v1.first * v2.second - v1.second * v2.first;
  if (prod > 0) return 1;
  if (prod < 0) return -1;
  return 0;
}
bool entre(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  if (min(a.first, b.first) <= c.first && c.first <= max(a.first, b.first) &&
      min(a.second, b.second) <= c.second && c.second <= max(a.first, b.second))
    return true;
  return false;
}
bool inside(vector<pair<int, int> > square1, vector<pair<int, int> > square2) {
  bool ans = true;
  int dir = cross(square1[0], square1[1], square2[0]);
  for (int i = 0; i < 4; ++i) {
    pair<int, int> a = square1[i], b = square1[(i + 1) % 4];
    for (int j = 0; j < 4; ++j)
      if (cross(a, b, square2[j]) != dir) ans = false;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<pair<int, int> > square1(4), square2(4);
  for (int i = 0; i < 4; ++i) cin >> square1[i].first >> square1[i].second;
  for (int i = 0; i < 4; ++i) cin >> square2[i].first >> square2[i].second;
  bool ans = inside(square1, square2) | inside(square2, square1);
  for (int i = 0; i < 4; ++i) {
    pair<int, int> a = square1[i], b = square1[(i + 1) % 4];
    for (int j = 0; j < 4; ++j) {
      pair<int, int> c = square2[j], d = square2[(j + 1) % 4];
      int dir1 = cross(a, b, c);
      int dir2 = cross(a, b, d);
      int dir3 = cross(c, d, a);
      int dir4 = cross(c, d, b);
      if (dir1 != dir2 && dir3 != dir4) ans = true;
      if (dir1 == 0 && entre(a, b, c)) ans = true;
      if (dir2 == 0 && entre(a, b, d)) ans = true;
      if (dir3 == 0 && entre(c, d, a)) ans = true;
      if (dir4 == 0 && entre(c, d, b)) ans = true;
    }
  }
  if (ans)
    cout << "YES\n";
  else
    cout << "NO\n";
}
