#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300;
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
};
typedef Point Polygon[MAXN];
template <typename T>
inline void read(T &x) {
  int c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
Point read_Vector() {
  double x, y;
  scanf("%lf%lf", &x, &y);
  return Point(x, y);
}
int dcmp(double x) {
  if (fabs(x) < 1e-8)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
Point operator+(Point A, Point B) { return Point(A.x + B.x, A.y + B.y); }
Point operator-(Point A, Point B) { return Point(A.x - B.x, A.y - B.y); }
Point operator*(Point A, double B) { return Point(A.x * B, A.y * B); }
Point operator/(Point A, double B) { return Point(A.x / B, A.y / B); }
bool operator==(const Point &a, const Point &b) {
  return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
double Dot(Point A, Point B) { return A.x * B.x + A.y * B.y; }
double Length(Point A) { return sqrt(A.x * A.x + A.y * A.y); }
double Angle(Point A, Point B) {
  return acos(Dot(A, B) / Length(A) / Length(B));
}
double Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
double GetS(Point A, Point B, Point C) { return Cross(B - A, C - A); }
Point Rotate(Point A, double rad) {
  return Point(A.x * cos(rad) - A.y * sin(rad),
               A.x * sin(rad) - A.y * cos(rad));
}
Point Normal(Point A) {
  double L = Length(A);
  return Point(-A.y / L, A.x / L);
}
Point Inter(Point P, Point v, Point Q, Point w) {
  Point u = (P - Q);
  double t = Cross(w, u) / Cross(v, w);
  return P + v * t;
}
double DisP2L(Point P, Point A, Point B) {
  Point v1 = B - A, v2 = P - A;
  return fabs(Cross(v1, v2)) / Length(v1);
}
double DisP2S(Point P, Point A, Point B) {
  if (A == B) return Length(P - A);
  Point v1 = B - A, v2 = P - A, v3 = P - B;
  if (dcmp(Dot(v1, v2)) < 0)
    return Length(v2);
  else if (dcmp(Dot(v1, v3)) > 0)
    return Length(v3);
  else
    return fabs(Cross(v1, v2)) / Length(v1);
}
bool checkSegment(Point a, Point b, Point c, Point d) {
  double c1 = Cross(b - a, c - a), c2 = Cross(b - a, d - a);
  double c3 = Cross(d - c, a - c), c4 = Cross(d - c, b - c);
  return dcmp(c1) * dcmp(c2) < 0 && dcmp(c3) * dcmp(c4) < 0;
}
bool OnSegment(Point p, Point a1, Point a2) {
  return dcmp(Cross(a1 - p, a2 - p)) == 0 && dcmp(Dot(a1 - p, a2 - p)) < 0;
}
double ConvexArea(Point *P, int N) {
  double area = 0;
  for (int i = 2; i < N; i++) area += Cross(P[i] - P[1], P[i + 1] - P[1]);
  return area / 2;
}
int PinPolygon(Point P, Polygon poly, int N) {
  int wn = 0;
  poly[N + 1] = poly[1];
  for (int i = 1; i <= N; i++) {
    if (OnSegment(P, poly[i], poly[(i + 1)])) return -1;
    int k = dcmp(Cross(poly[i + 1] - poly[i], P - poly[i]));
    int d1 = dcmp(poly[i].y - P.y);
    int d2 = dcmp(poly[i + 1].y - P.y);
    if (k > 0 && d1 <= 0 && d2 > 0) wn++;
    if (k < 0 && d2 <= 0 && d1 > 0) wn--;
  }
  if (wn)
    return 1;
  else
    return 0;
}
bool operator<(Point a, Point b) {
  return a.x < b.x || (a.x == b.x && a.y < b.y);
}
int ConvexHull(Point *p, int N, Point *ch) {
  sort(p + 1, p + N + 1);
  int sum = 0;
  for (int i = 1; i <= N; i++) {
    while (sum > 1 && Cross(ch[sum - 1] - ch[sum - 2], p[i] - ch[sum - 2]) <= 0)
      sum--;
    ch[sum++] = p[i];
  }
  int k = sum;
  for (int i = N - 1; i; i--) {
    while (sum > k && Cross(ch[sum - 1] - ch[sum - 2], p[i] - ch[sum - 2]) <= 0)
      sum--;
    ch[sum++] = p[i];
  }
  (N > 1) && (sum--);
  return sum;
}
Point a[6], b[6];
const int n = 4;
signed main() {
  for (int i = 1; i <= 4; i++) a[i] = read_Vector();
  for (int i = 1; i <= 4; i++) b[i] = read_Vector();
  a[5] = a[1], b[5] = b[1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (OnSegment(a[i], b[j], b[j + 1])) {
        puts("YES");
        return 0;
      }
      if (OnSegment(a[i + 1], b[j], b[j + 1])) {
        puts("YES");
        return 0;
      }
      if (OnSegment(b[j], a[i], a[i + 1])) {
        puts("YES");
        return 0;
      }
      if (OnSegment(b[j + 1], a[i], a[i + 1])) {
        puts("YES");
        return 0;
      }
      if (checkSegment(a[i], a[i + 1], b[j], b[j + 1])) {
        puts("YES");
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i] == b[j]) {
        puts("YES");
        return 0;
      }
    }
  }
  if (PinPolygon(b[1], a, 4)) {
    puts("YES");
    return 0;
  }
  if (PinPolygon(a[1], b, 4)) {
    puts("YES");
    return 0;
  }
  puts("NO");
  return 0;
}
