#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
pair<int, int> sq[4], qs[4];
struct Vector {
  double x, y;
  Vector() {}
  Vector(double xx, double yy) : x(xx), y(yy) {}
  bool operator<(const Vector &other) {
    return x == other.x ? y < other.y : x < other.x;
  }
  bool operator==(const Vector &other) { return x == other.x && y == other.y; }
  Vector operator-(const Vector &other) {
    return Vector(x - other.x, y - other.y);
  }
  double cross(const Vector &other) { return x * other.y - y * other.x; }
};
int ccw(Vector a, Vector b) {
  double get = a.cross(b);
  if (get > 0) return 1;
  if (get < 0) return -1;
  return 0;
}
int ccw(Vector p, Vector a, Vector b) { return ccw(a - p, b - p); }
int isCross(Vector a, Vector b, Vector c, Vector d) {
  if (ccw(a, b, c) == 0 && ccw(a, b, d) == 0) {
    if (b < a) swap(a, b);
    if (d < c) swap(c, d);
    if (b < c || d < a) return 0;
    if (b == c || a == d) return 1;
    return 1;
  }
  if (ccw(a, b, c) == ccw(a, b, d) || ccw(c, d, a) == ccw(c, d, b)) return 0;
  return 1;
}
int save[4][2] = {{0, 1}, {1, 3}, {3, 2}, {0, 2}};
int main() {
  for (int i = 0; i < 4; i++) scanf("%d%d", &sq[i].first, &sq[i].second);
  for (int i = 0; i < 4; i++) scanf("%d%d", &qs[i].first, &qs[i].second);
  sort(sq, sq + 4);
  sort(qs, qs + 4);
  bool flag = false;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      flag |= isCross(Vector(sq[save[i][0]].first, sq[save[i][0]].second),
                      Vector(sq[save[i][1]].first, sq[save[i][1]].second),
                      Vector(qs[save[j][0]].first, qs[save[j][0]].second),
                      Vector(qs[save[j][1]].first, qs[save[j][1]].second));
    }
  }
  if (flag)
    printf("YES");
  else {
    double smx = (sq[0].first + sq[2].first) / 2.,
           smy = (sq[0].second + sq[1].second) / 2.;
    double qmx = (qs[0].first + qs[3].first) / 2.,
           qmy = (qs[1].second + qs[2].second) / 2.;
    int ccnt = 0;
    for (int i = 0; i < 4; i++) {
      if (isCross(Vector(qs[save[i][0]].first, qs[save[i][0]].second),
                  Vector(qs[save[i][1]].first, qs[save[i][1]].second),
                  Vector(smx, smy), Vector(qmx, qmy)) == 0)
        ccnt++;
    }
    if (ccnt == 4) flag = true;
    ccnt = 0;
    for (int i = 0; i < 4; i++) {
      if (isCross(Vector(sq[save[i][0]].first, sq[save[i][0]].second),
                  Vector(sq[save[i][1]].first, sq[save[i][1]].second),
                  Vector(smx, smy), Vector(qmx, qmy)) == 0)
        ccnt++;
    }
    if (ccnt == 4) flag = true;
    if (flag)
      printf("YES");
    else
      printf("NO");
  }
  return 0;
}
