#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 * 1e5 + 17;
pair<int, int> first[5];
pair<int, int> second[5];
pair<int, int> vec(pair<int, int> x, pair<int, int> y) {
  return {y.first - x.first, y.second - x.second};
}
int dot(pair<int, int> x, pair<int, int> y) {
  return x.first * y.first + x.second * y.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  for (int i = 0; i < 4; i++)
    cin >> first[i].first >> first[i].second, first[4].first += first[i].first,
        first[4].second += first[i].second;
  for (int i = 0; i < 4; i++)
    cin >> second[i].first >> second[i].second,
        second[4].first += second[i].first,
        second[4].second += second[i].second;
  first[4].first /= 4;
  first[4].second /= 4;
  second[4].first /= 4;
  second[4].second /= 4;
  for (int i = 0; i < 5; i++) {
    pair<int, int> X = first[i];
    pair<int, int> AB = vec(second[0], second[1]);
    pair<int, int> AX = vec(second[0], X);
    pair<int, int> BC = vec(second[1], second[2]);
    pair<int, int> BX = vec(second[1], X);
    if (0 <= dot(AB, AX) && dot(AB, AX) <= dot(AB, AB) && 0 <= dot(BC, BX) &&
        dot(BC, BX) <= dot(BC, BC))
      puts("YES"), exit(0);
  }
  for (int i = 0; i < 5; i++) {
    pair<int, int> X = second[i];
    pair<int, int> AB = vec(first[0], first[1]);
    pair<int, int> AX = vec(first[0], X);
    pair<int, int> BC = vec(first[1], first[2]);
    pair<int, int> BX = vec(first[1], X);
    if (0 <= dot(AB, AX) && dot(AB, AX) <= dot(AB, AB) && 0 <= dot(BC, BX) &&
        dot(BC, BX) <= dot(BC, BC))
      puts("YES"), exit(0);
  }
  puts("NO");
  return 0;
}
