#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
struct Point {
  int x, y;
};
bool onSegment(Point p, Point q, Point r) {
  if (q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) &&
      q.y >= min(p.y, r.y))
    return true;
  return false;
}
int orientation(Point p, Point q, Point r) {
  int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
bool doIntersect(Point p1, Point q1, Point p2, Point q2) {
  int o1 = orientation(p1, q1, p2);
  int o2 = orientation(p1, q1, q2);
  int o3 = orientation(p2, q2, p1);
  int o4 = orientation(p2, q2, q1);
  if (o1 != o2 && o3 != o4) return true;
  if (o1 == 0 && onSegment(p1, p2, q1)) return true;
  if (o2 == 0 && onSegment(p1, q2, q1)) return true;
  if (o3 == 0 && onSegment(p2, p1, q2)) return true;
  if (o4 == 0 && onSegment(p2, q1, q2)) return true;
  return false;
}
int AinB(int r, int q, Point p[]) {
  int minx = INT_MAX, miny = INT_MAX, maxx = INT_MIN, maxy = INT_MIN;
  for (int i = 0; i < 4; ++i) {
    if (p[i].x < minx) minx = p[i].x;
    if (p[i].y < miny) miny = p[i].y;
    if (p[i].x > maxx) maxx = p[i].x;
    if (p[i].y > maxy) maxy = p[i].y;
  }
  return minx <= r && r <= maxx && miny <= q && q <= maxy;
}
int BinA(int r, int q, Point p[]) {
  int x = r + q, y = r - q;
  int minx = INT_MAX, miny = INT_MAX, maxx = INT_MIN, maxy = INT_MIN;
  for (int i = 0; i < 4; ++i) {
    int t1 = p[i].x + p[i].y, t2 = p[i].x - p[i].y;
    if (t1 < minx) minx = t1;
    if (t2 < miny) miny = t2;
    if (t1 > maxx) maxx = t1;
    if (t2 > maxy) maxy = t2;
  }
  return minx <= x && x <= maxx && miny <= y && y <= maxy;
}
int main() {
  Point p1[4], p2[4];
  for (int i = 0; i < 4; ++i) {
    cin >> p1[i].x;
    cin >> p1[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> p2[i].x;
    cin >> p2[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    if (AinB(p2[i].x, p2[i].y, p1)) {
      cout << "YES" << '\n';
      return 0;
    }
  }
  for (int i = 0; i < 4; ++i) {
    if (BinA(p1[i].x, p1[i].y, p2)) {
      cout << "YES" << '\n';
      return 0;
    }
  }
  for (int i = 0; i < 4; ++i) {
    Point t1 = p1[i], t2;
    if (i + 1 == 4) {
      t1 = p1[0];
      t2 = p1[i];
    } else
      t2 = p1[i + 1];
    for (int j = 0; j < 4; ++j) {
      Point t3 = p2[j], t4;
      if (j + 1 == 4) {
        t3 = p2[0];
        t4 = p2[j];
      } else
        t4 = p2[j + 1];
      if (doIntersect(t1, t2, t3, t4)) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  cout << "NO" << '\n';
}
