#include <bits/stdc++.h>
using namespace std;
float area(long long x1, long long y1, long long x2, long long y2, long long x3,
           long long y3) {
  return abs(((x1 * (y2 - y3)) + (x2 * (y3 - y1)) + (x3 * (y1 - y2))) / 2.0);
}
bool check(long long x1, long long y1, long long x2, long long y2, long long x3,
           long long y3, long long x4, long long y4, long long x, long long y) {
  float A = area(x1, y1, x2, y2, x3, y3) + area(x1, y1, x4, y4, x3, y3);
  float A1 = area(x, y, x1, y1, x2, y2);
  float A2 = area(x, y, x2, y2, x3, y3);
  float A3 = area(x, y, x3, y3, x4, y4);
  float A4 = area(x, y, x1, y1, x4, y4);
  return (A == A1 + A2 + A3 + A4);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long x1, x2, x3, x4, y1, y2, y3, y4;
  long long x5, x6, x7, x8, y5, y6, y7, y8;
  long long c = 0;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
  cin >> x5 >> y5 >> x6 >> y6 >> x7 >> y7 >> x8 >> y8;
  c += check(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5);
  c += check(x1, y1, x2, y2, x3, y3, x4, y4, x6, y6);
  c += check(x1, y1, x2, y2, x3, y3, x4, y4, x7, y7);
  c += check(x1, y1, x2, y2, x3, y3, x4, y4, x8, y8);
  c += check(x5, y5, x6, y6, x7, y7, x8, y8, x1, y1);
  c += check(x5, y5, x6, y6, x7, y7, x8, y8, x2, y2);
  c += check(x5, y5, x6, y6, x7, y7, x8, y8, x3, y3);
  c += check(x5, y5, x6, y6, x7, y7, x8, y8, x4, y4);
  long long val = (x1 + x2 + x3 + x4) / 4;
  long long val1 = (y1 + y2 + y3 + y4) / 4;
  c += check(x5, y5, x6, y6, x7, y7, x8, y8, val, val1);
  if (c > 0) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
