#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-8;
const long double PI = acos(-1.0);
int sgn(long double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
struct Point {
  long double x, y;
  Point() {}
  Point(long double _x, long double _y) {
    x = _x;
    y = _y;
  }
  void input() { scanf("%Lf%Lf", &x, &y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  long double operator^(const Point &b) const { return x * b.y - y * b.x; }
  long double operator*(const Point &b) const { return x * b.x + y * b.y; }
};
struct Line {
  Point s, e;
  long double k;
  Line() {}
  Line(Point _s, Point _e) {
    s = _s;
    e = _e;
    k = atan2(e.y - s.y, e.x - s.x);
  }
  Point operator&(const Line &b) const {
    Point res = s;
    long double t = ((s - b.s) ^ (b.s - b.e)) / ((s - e) ^ (b.s - b.e));
    res.x += (e.x - s.x) * t;
    res.y += (e.y - s.y) * t;
    return res;
  }
};
bool HPIcmp(Line a, Line b) {
  if (fabs(a.k - b.k) > eps) return a.k < b.k;
  return ((a.s - b.s) ^ (b.e - b.s)) < 0;
}
Line Q[110];
void HPI(Line line[], int n, Point res[], int &resn) {
  int tot = n;
  sort(line, line + n, HPIcmp);
  tot = 1;
  for (int i = 1; i < n; i++)
    if (fabs(line[i].k - line[i - 1].k) > eps) line[tot++] = line[i];
  int head = 0, tail = 1;
  Q[0] = line[0];
  Q[1] = line[1];
  resn = 0;
  for (int i = 2; i < tot; i++) {
    if (fabs((Q[tail].e - Q[tail].s) ^ (Q[tail - 1].e - Q[tail - 1].s)) < eps ||
        fabs((Q[head].e - Q[head].s) ^ (Q[head + 1].e - Q[head + 1].s)) < eps)
      return;
    while (head < tail && (((Q[tail] & Q[tail - 1]) - line[i].s) ^
                           (line[i].e - line[i].s)) > eps)
      tail--;
    while (head < tail && (((Q[head] & Q[head + 1]) - line[i].s) ^
                           (line[i].e - line[i].s)) > eps)
      head++;
    Q[++tail] = line[i];
  }
  while (head < tail && (((Q[tail] & Q[tail - 1]) - Q[head].s) ^
                         (Q[head].e - Q[head].s)) > eps)
    tail--;
  while (head < tail && (((Q[head] & Q[head - 1]) - Q[tail].s) ^
                         (Q[tail].e - Q[tail].e)) > eps)
    head++;
  if (tail <= head + 1) return;
  for (int i = head; i < tail; i++) res[resn++] = Q[i] & Q[i + 1];
  if (head < tail - 1) res[resn++] = Q[head] & Q[tail];
}
long double CalcArea(Point p[], int n) {
  long double res = 0;
  for (int i = 0; i < n; i++) res += (p[i] ^ p[(i + 1) % n]) / 2;
  return fabs(res);
}
long double TrueCalcArea(Point p[], int n) {
  long double res = 0;
  for (int i = 0; i < n; i++) res += (p[i] ^ p[(i + 1) % n]) / 2;
  return res;
}
bool OnSeg(Point P, Line L) {
  return sgn((L.s - P) ^ (L.e - P)) == 0 &&
         sgn((P.x - L.s.x) * (P.x - L.e.x)) <= 0 &&
         sgn((P.y - L.s.y) * (P.y - L.e.y)) <= 0;
}
int main() {
  Line l[10];
  int n = 0;
  Point p1[10];
  for (int i = 0; i < 4; i++) p1[i].input();
  if (TrueCalcArea(p1, 4) < 0) reverse(p1, p1 + 4);
  for (int i = 0; i < 4; i++) l[n++] = Line(p1[i], p1[(i + 1) % 4]);
  Point p2[10];
  for (int i = 0; i < 4; i++) p2[i].input();
  if (TrueCalcArea(p2, 4) < 0) reverse(p2, p2 + 4);
  for (int i = 0; i < 4; i++) l[n++] = Line(p2[i], p2[(i + 1) % 4]);
  Point res[100];
  int resn;
  HPI(l, n, res, resn);
  if (CalcArea(res, resn) > 0) return 0 * printf("YES\n");
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (OnSeg(p1[i], Line(p2[j], p2[(j + 1) % 4])))
        return 0 * printf("YES\n");
      if (OnSeg(p2[i], Line(p1[j], p1[(j + 1) % 4])))
        return 0 * printf("YES\n");
    }
  printf("NO\n");
}
