#include <bits/stdc++.h>
using namespace std;
struct Vec2 {
  double x, y;
  Vec2() : x{0}, y{0} {}
  Vec2(double _x, double _y) : x{_x}, y{_y} {}
  Vec2 operator+(const Vec2 &o) { return Vec2{x + o.x, y + o.y}; }
  Vec2 operator-(const Vec2 &o) { return Vec2{x - o.x, y - o.y}; }
  Vec2 operator*(double c) { return Vec2{c * x, c * y}; }
};
inline Vec2 operator*(double c, Vec2 v) { return v * c; }
double dot(Vec2 v, Vec2 u) { return v.x * u.x + v.y * u.y; }
double cross(Vec2 v, Vec2 u) { return v.x * u.y - v.y * u.x; }
double dist(Vec2 v, Vec2 u) { return sqrt(dot(u - v, u - v)); }
bool seg_intersect(Vec2 a, Vec2 b, Vec2 c, Vec2 d) {
  Vec2 v = b - a, u = d - c;
  double den = cross(v, u), s, t;
  if (fabs(den) > 1E-10) {
    s = cross(v, a - c) / den;
    t = cross(u, a - c) / den;
    return 0 <= s && s <= 1 && 0 <= t && t <= 1;
  }
  return false;
}
Vec2 center(const vector<Vec2> &points) {
  Vec2 sm;
  if (!points.size()) return sm;
  for (auto p : points) sm = sm + p;
  return 1.0 / points.size() * sm;
}
bool inside_rotated(Vec2 p, const vector<Vec2> &sq) {
  Vec2 cen = center(sq);
  double side = dist(sq[0], sq[1]);
  return abs(p.x - cen.x) + abs(p.y - cen.y) <= side / sqrt(2);
}
bool inside_straight(Vec2 p, const vector<Vec2> &sq) {
  Vec2 cen = center(sq);
  double side = dist(sq[0], sq[1]);
  return abs(p.x - cen.x) <= side / 2 && abs(p.y - cen.y) <= side / 2;
}
int main() {
  vector<Vec2> straight, rotated;
  double x, y;
  for (int i = 0; i < 4; i++) {
    cin >> x >> y;
    straight.push_back(Vec2{x, y});
  }
  for (int i = 0; i < 4; i++) {
    cin >> x >> y;
    rotated.push_back(Vec2{x, y});
  }
  if (inside_rotated(center(straight), rotated) ||
      inside_straight(center(rotated), straight)) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (seg_intersect(straight[i], straight[(i + 1) % 4], rotated[j],
                        rotated[(j + 1) % 4])) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
