#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using pii = pair<int, int>;
pii operator-(const pii& a, const pii& b) {
  return {a.first - b.first, a.second - b.second};
}
int operator^(const pii& a, const pii& b) {
  return a.first * b.second - a.second * b.first;
}
int operator*(const pii& a, const pii& b) {
  return a.first * b.first + a.second * b.second;
}
bool is_on(pii a, pii b, pii c) {
  return (b - a ^ c - a) == 0 && (b - a) * (c - a) <= 0;
}
int area(pii a, pii b, pii c) { return abs(a - b ^ c - b); }
bool is_in(pii a, pii b, pii c, pii d, pii e) {
  return area(a, b, c) + area(a, c, d) + area(a, d, e) + area(a, e, b) ==
         area(b, c, d) + area(b, d, e);
}
bool inter(pii a, pii b, pii c, pii d) {
  return (c - a ^ b - a) * (d - a ^ b - a) < 0 &&
         (a - d ^ c - d) * (b - d ^ c - d) < 0;
}
int main() {
  pii a[10], b[10];
  for (int i = 0; i < 4; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < 4; i++) cin >> b[i].first >> b[i].second;
  a[4] = a[0];
  b[4] = b[0];
  for (int i = 0; i < 4; i++) {
    if (is_in(a[i], b[0], b[1], b[2], b[3])) return puts("YES"), 0;
  }
  for (int i = 0; i < 4; i++)
    if (is_in(b[i], a[0], a[1], a[2], a[3])) return puts("YES"), 0;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (is_on(a[i], b[j], b[j + 1])) return puts("YES"), 0;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (is_on(b[i], a[j], a[j + 1])) return puts("YES"), 0;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (inter(a[i], a[i + 1], b[j], b[j + 1])) return puts("YES"), 0;
  puts("NO");
  return 0;
}
