#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x;
  int 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;
}
bool lines(Point p[], Point q[]) {
  bool b = false;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (doIntersect(p[i], p[(i + 1) % 4], q[j], q[(j + 1) % 4])) {
        b = true;
      }
    }
  }
  return b;
}
float area(int x1, int y1, int x2, int y2, int x3, int y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
bool isInside(Point p1, Point p2, Point p3, Point p) {
  int x1 = p1.x, y1 = p1.y, y2 = p2.y, x2 = p2.x, x3 = p3.x, y3 = p3.y, x = p.x,
      y = p.y;
  float A = area(x1, y1, x2, y2, x3, y3);
  float A1 = area(x, y, x2, y2, x3, y3);
  float A2 = area(x1, y1, x, y, x3, y3);
  float A3 = area(x1, y1, x2, y2, x, y);
  return (A == A1 + A2 + A3);
}
bool inside(Point p[], Point q[]) {
  bool b = false;
  for (int i = 0; i < 4; ++i) {
    if (isInside(p[1], p[2], p[3], q[i])) {
      b = true;
    }
    if (isInside(p[2], p[3], p[0], q[i])) {
      b = true;
    }
    if (isInside(q[1], q[2], q[3], p[i])) {
      b = true;
    }
    if (isInside(q[2], q[3], q[0], p[i])) {
      b = true;
    }
  }
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  struct Point p[4], q[4];
  for (int i = 0; i < 4; ++i) {
    cin >> p[i].x >> p[i].y;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> q[i].x >> q[i].y;
  }
  if (lines(p, q) || inside(p, q)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
