#include <bits/stdc++.h>
using namespace std;
int main() {
  int Ax[4];
  int Bx[4];
  int By[4];
  int Ay[4];
  int i;
  for (i = 0; i < 4; i++) {
    cin >> Ax[i] >> Ay[i];
  }
  for (i = 0; i < 4; i++) {
    cin >> Bx[i] >> By[i];
  }
  set<int> s(Ax, Ax + 4);
  if (s.size() == 2) {
    int xmin = min(Ax[0], min(Ax[1], min(Ax[2], Ax[3])));
    int xmax = max(Ax[0], max(Ax[1], max(Ax[2], Ax[3])));
    int ymin = min(Ay[0], min(Ay[1], min(Ay[2], Ay[3])));
    int ymax = max(Ay[0], max(Ay[1], max(Ay[2], Ay[3])));
    float cenx = (Bx[0] + Bx[1] + Bx[2] + Bx[3]) / 4.0;
    float ceny = (By[0] + By[1] + By[2] + By[3]) / 4.0;
    for (i = 0; i < 4; i++) {
      if (Bx[i] >= xmin && Bx[i] <= xmax && By[i] >= ymin && By[i] <= ymax) {
        cout << "YES" << endl;
        return 0;
      }
    }
    if (cenx >= xmin && cenx <= xmax && ceny >= ymin && ceny <= ymax) {
      cout << "YES" << endl;
      return 0;
    }
    xmin = min(Bx[0], min(Bx[1], min(Bx[2], Bx[3])));
    xmax = max(Bx[0], max(Bx[1], max(Bx[2], Bx[3])));
    ymin = min(By[0], min(By[1], min(By[2], By[3])));
    ymax = max(By[0], max(By[1], max(By[2], By[3])));
    float cx = (xmin + xmax) / 2.0;
    float cy = (ymin + ymax) / 2.0;
    float txmin = xmin - cx;
    float txmax = xmax - cx;
    float tymin = ymin - cy;
    float tymax = ymax - cy;
    for (i = 0; i < 4; i++) {
      float tx = abs(Ax[i] - cx);
      float ty = abs(Ay[i] - cy);
      if (tx + ty - txmax <= 0 && tx <= txmax && ty <= tymax) {
        cout << "YES" << endl;
        return 0;
      }
    }
  } else {
    int xmin = min(Bx[0], min(Bx[1], min(Bx[2], Bx[3])));
    int xmax = max(Bx[0], max(Bx[1], max(Bx[2], Bx[3])));
    int ymin = min(By[0], min(By[1], min(By[2], By[3])));
    int ymax = max(By[0], max(By[1], max(By[2], By[3])));
    float cenx = (Ax[0] + Ax[1] + Ax[2] + Ax[3]) / 4.0;
    float ceny = (Ay[0] + Ay[1] + Ay[2] + Ay[3]) / 4.0;
    if (cenx >= xmin && cenx <= xmax && ceny >= ymin && ceny <= ymax) {
      cout << "YES" << endl;
      return 0;
    }
    for (i = 0; i < 4; i++) {
      if (Ax[i] >= xmin && Ax[i] <= xmax && Ay[i] >= ymin && Ay[i] <= ymax) {
        cout << "YES" << endl;
        return 0;
      }
    }
    xmin = min(Ax[0], min(Ax[1], min(Ax[2], Ax[3])));
    xmax = max(Ax[0], max(Ax[1], max(Ax[2], Ax[3])));
    ymin = min(Ay[0], min(Ay[1], min(Ay[2], Ay[3])));
    ymax = max(Ay[0], max(Ay[1], max(Ay[2], Ay[3])));
    float cx = (xmin + xmax) / 2.0;
    float cy = (ymin + ymax) / 2.0;
    float txmin = xmin - cx;
    float txmax = xmax - cx;
    float tymin = ymin - cy;
    float tymax = ymax - cy;
    for (i = 0; i < 4; i++) {
      float tx = abs(Bx[i] - cx);
      float ty = abs(By[i] - cy);
      if (tx + ty - txmax <= 0 && tx <= txmax && ty <= tymax) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
