#include <bits/stdc++.h>
using namespace std;
struct Square {
  pair<long long, long long> p[5];
};
Square a, b;
long long S(pair<long long, long long> x, pair<long long, long long> y,
            pair<long long, long long> z) {
  long long sx = (y.first - x.first) * (y.second + x.second);
  long long sy = (z.first - y.first) * (z.second + y.second);
  long long sz = (x.first - z.first) * (x.second + z.second);
  return abs(sx + sy + sz);
}
long long SSquare(Square x) {
  long long s0 =
      (x.p[1].first - x.p[0].first) * (x.p[1].second + x.p[0].second);
  long long s1 =
      (x.p[2].first - x.p[1].first) * (x.p[2].second + x.p[1].second);
  long long s2 =
      (x.p[3].first - x.p[2].first) * (x.p[3].second + x.p[2].second);
  long long s3 =
      (x.p[0].first - x.p[3].first) * (x.p[0].second + x.p[3].second);
  return abs(s0 + s1 + s2 + s3);
}
bool Check_Point_In_Site(pair<long long, long long> x, Square a) {
  long long s = 0, ss = SSquare(a);
  for (int i = 1; i <= 3; i++) s += S(x, a.p[i], a.p[i - 1]);
  s += S(x, a.p[3], a.p[0]);
  return (s == ss);
}
bool Check_In_Site(Square a, Square b) {
  for (int i = 0; i <= 4; i++) {
    if (Check_Point_In_Site(a.p[i], b)) return true;
    if (Check_Point_In_Site(b.p[i], a)) return true;
  }
  return false;
}
pair<long long, long long> Center_Square(Square a) {
  if (a.p[0].first == a.p[2].first) {
    return make_pair(a.p[0].first, a.p[1].second);
  }
  if (a.p[1].first == a.p[3].first) {
    return make_pair(a.p[1].first, a.p[2].second);
  }
  if (a.p[1].first != a.p[2].first) {
    return make_pair(a.p[1].first + a.p[2].first >> 1,
                     a.p[0].second + a.p[1].second >> 1);
  }
  if (a.p[0].first != a.p[1].first) {
    return make_pair(a.p[0].first + a.p[1].first >> 1,
                     a.p[1].second + a.p[2].second >> 1);
  }
}
int main() {
  for (int i = 0; i <= 3; i++) cin >> a.p[i].first >> a.p[i].second;
  a.p[4] = Center_Square(a);
  for (int i = 0; i <= 3; i++) cin >> b.p[i].first >> b.p[i].second;
  b.p[4] = Center_Square(b);
  if (Check_In_Site(a, b))
    cout << "YES";
  else
    cout << "NO";
}
