#include <bits/stdc++.h>
using namespace std;
int X1[5], X2[5], Y1[5], Y2[5];
double area(float x1, float y1, float x2, float y2, float x3, float y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
bool check(float x1, float y1, float x2, float y2, float x3, float y3, float x4,
           float y4, float x, float y) {
  double A = area(x1, y1, x2, y2, x3, y3) + area(x1, y1, x4, y4, x3, y3);
  double A1 = area(x, y, x1, y1, x2, y2);
  double A2 = area(x, y, x2, y2, x3, y3);
  double A3 = area(x, y, x3, y3, x4, y4);
  double A4 = area(x, y, x1, y1, x4, y4);
  return (A == A1 + A2 + A3 + A4);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int ind = 1;
  for (int i = 1; i <= 8; i++) {
    if (i % 2)
      scanf("%d", &X1[ind]);
    else
      scanf("%d", &Y1[ind]), ind++;
  }
  ind = 1;
  for (int i = 1; i <= 8; i++) {
    if (i % 2)
      scanf("%d", &X2[ind]);
    else
      scanf("%d", &Y2[ind]), ind++;
  }
  int bahar = 0, andar = 0;
  for (int i = 1; i <= 4; i++) {
    if (check(1.0 * X1[1], 1.0 * Y1[1], 1.0 * X1[2], 1.0 * Y1[2], 1.0 * X1[3],
              1.0 * Y1[3], 1.0 * X1[4], 1.0 * Y1[4], 1.0 * X2[i],
              1.0 * Y2[i])) {
      andar++;
    } else
      bahar++;
  }
  if (check(1.0 * X1[1], 1.0 * Y1[1], 1.0 * X1[2], 1.0 * Y1[2], 1.0 * X1[3],
            1.0 * Y1[3], 1.0 * X1[4], 1.0 * Y1[4], 1.0 * (X2[1] + X2[3]) / 2.0,
            1.0 * (Y2[1] + Y2[3]) / 2.0))
    andar++;
  if (andar) {
    cout << "YES";
    return 0;
  }
  int andar1 = 0, bahar1 = 0;
  for (int i = 1; i <= 4; i++) {
    if (check(1.0 * X2[1], 1.0 * Y2[1], 1.0 * X2[2], 1.0 * Y2[2], 1.0 * X2[3],
              1.0 * Y2[3], 1.0 * X2[4], 1.0 * Y2[4], 1.0 * X1[i],
              1.0 * Y1[i])) {
      andar1++;
    } else
      bahar1++;
  }
  if (check(1.0 * X2[1], 1.0 * Y2[1], 1.0 * X2[2], 1.0 * Y2[2], 1.0 * X2[3],
            1.0 * Y2[3], 1.0 * X2[4], 1.0 * Y2[4], 1.0 * (X1[1] + X1[3]) / 2.0,
            1.0 * (Y1[1] + Y1[3]) / 2.0))
    andar1++;
  if (andar1)
    cout << "YES";
  else
    cout << "NO";
}
