#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  Point(int _x = 0, int _y = 0) : x(_x), y(_y){};
  Point operator-(Point A) { return Point(x - A.x, y - A.y); }
  int operator^(Point A) { return x * A.y - A.x * y; }
};
int main() {
  Point p[2][5];
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 4; ++j) {
      scanf("%d%d", &p[i][j].x, &p[i][j].y);
      p[i][j].x *= 2;
      p[i][j].y *= 2;
    }
  for (int k = 0; k < 2; ++k)
    p[k][4] = Point((p[k][0].x + p[k][2].x) / 2, (p[k][0].y + p[k][2].y) / 2);
  set<int> val;
  int a;
  for (int k = 0; k < 2; ++k) {
    for (int j = 0; j < 5; ++j) {
      val.clear();
      for (int i = 0; i < 3; ++i) {
        a = (p[k][j] - p[k ^ 1][i]) ^ (p[k ^ 1][i + 1] - p[k ^ 1][i]);
        if (a == 0) continue;
        if (a > 0)
          a = 1;
        else
          a = -1;
        val.insert(a);
      }
      a = (p[k][j] - p[k ^ 1][3]) ^ (p[k ^ 1][0] - p[k ^ 1][3]);
      if (a != 0) {
        if (a > 0)
          a = 1;
        else
          a = -1;
        val.insert(a);
      }
      if (int(val.size()) == 1) {
        printf("YES");
        return 0;
      }
    }
  }
  printf("NO");
}
