#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
struct Point {
  int x, y;
};
int orientation(Point p1, Point p2, Point p3) {
  int val = (p2.y - p1.y) * (p3.x - p2.x) - (p2.x - p1.x) * (p3.y - p2.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
bool cmp(Point a, Point b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
bool cw(Point a, Point b, Point c) {
  return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) < 0;
}
bool ccw(Point a, Point b, Point c) {
  return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) > 0;
}
void convex_hull(vector<Point>& a) {
  if (a.size() == 1) return;
  sort(a.begin(), a.end(), &cmp);
  Point p1 = a[0], p2 = a.back();
  vector<Point> up, down;
  up.push_back(p1);
  down.push_back(p1);
  for (int i = 1; i < (int)a.size(); i++) {
    if (i == a.size() - 1 || cw(p1, a[i], p2)) {
      while (up.size() >= 2 && !cw(up[up.size() - 2], up[up.size() - 1], a[i]))
        up.pop_back();
      up.push_back(a[i]);
    }
    if (i == a.size() - 1 || ccw(p1, a[i], p2)) {
      while (down.size() >= 2 &&
             !ccw(down[down.size() - 2], down[down.size() - 1], a[i]))
        down.pop_back();
      down.push_back(a[i]);
    }
  }
  a.clear();
  for (int i = 0; i < (int)up.size(); i++) a.push_back(up[i]);
  for (int i = down.size() - 2; i > 0; i--) a.push_back(down[i]);
}
int main() {
  Point P[2][4];
  cin >> P[0][0].x >> P[0][0].y >> P[0][1].x >> P[0][1].y >> P[0][2].x >>
      P[0][2].y >> P[0][3].x >> P[0][3].y;
  cin >> P[1][0].x >> P[1][0].y >> P[1][1].x >> P[1][1].y >> P[1][2].x >>
      P[1][2].y >> P[1][3].x >> P[1][3].y;
  vector<Point> pts;
  for (int i = 0; i < 4; ++i) {
    pts.push_back(P[0][i]);
    pts.push_back(P[1][i]);
  }
  int x[2];
  x[0] = orientation(P[0][0], P[0][1], P[0][2]);
  x[1] = orientation(P[1][0], P[1][1], P[1][2]);
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 4; ++j) {
      bool in = true;
      for (int k = 0; k < 4; ++k) {
        int y = orientation(P[(i + 1) % 2][k], P[(i + 1) % 2][(k + 1) % 4],
                            P[i][j]);
        if (y == 0) {
          if (P[i][j].x >
                  max(P[(i + 1) % 2][k].x, P[(i + 1) % 2][(k + 1) % 4].x) ||
              P[i][j].x <
                  min(P[(i + 1) % 2][k].x, P[(i + 1) % 2][(k + 1) % 4].x) ||
              P[i][j].y >
                  max(P[(i + 1) % 2][k].y, P[(i + 1) % 2][(k + 1) % 4].y) ||
              P[i][j].y <
                  min(P[(i + 1) % 2][k].y, P[(i + 1) % 2][(k + 1) % 4].y)) {
            in = false;
            break;
          }
        } else if (y != x[(i + 1) % 2]) {
          in = false;
          break;
        }
      }
      if (in) {
        cout << "YES";
        return 0;
      }
    }
  }
  bool last = false;
  convex_hull(pts);
  if (pts.size() == 8) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
