#include <bits/stdc++.h>
using namespace std;
struct Square {
  int x[5], y[5];
};
void read(Square &s) {
  for (int i = 1; i <= 4; i++) cin >> s.x[i] >> s.y[i];
}
double atri(int xa, int ya, int xb, int yb, int xc, int yc) {
  return (double)(xc - xa) * (yb - ya) - (double)(xb - xa) * (yc - ya);
}
bool isinsq(int x, int y, Square s) {
  int m = 0, p = 0, eq = 0;
  for (int i = 1; i <= 4; i++) {
    int i1 = i + 1;
    if (i1 == 5) i1 = 1;
    double atr = atri(s.x[i], s.y[i], s.x[i1], s.y[i1], x, y);
    if (atr > 0.0)
      p++;
    else if (atr == 0.0)
      eq++;
    else
      m++;
  }
  return (abs(p - m) == 4 - eq);
}
bool its(int xa1, int ya1, int xa2, int ya2, int xb1, int yb1, int xb2,
         int yb2) {
  if (!(atri(xa1, ya1, xb1, yb1, xb2, yb2) *
            atri(xa2, ya2, xb1, yb1, xb2, yb2) <=
        0))
    return 0;
  if (!(atri(xb1, yb1, xa1, ya1, xa2, ya2) *
            atri(xb2, yb2, xa1, ya1, xa2, ya2) <=
        0))
    return 0;
  return 1;
}
Square s1, s2;
int main() {
  read(s1);
  read(s2);
  for (int i = 1; i <= 4; i++)
    if (isinsq(s1.x[i], s1.y[i], s2)) {
      cout << "YES\n";
      return 0;
    }
  for (int i = 1; i <= 4; i++)
    if (isinsq(s2.x[i], s2.y[i], s1)) {
      cout << "YES\n";
      return 0;
    }
  for (int i = 1; i <= 4; i++) {
    int i1 = i + 1;
    if (i1 == 5) i1 = 1;
    for (int j = 1; j <= 4; j++) {
      int j1 = j + 1;
      if (j1 == 5) j1 = 1;
      if (its(s1.x[i], s1.y[i], s1.x[i1], s1.y[i1], s2.x[j], s2.y[j], s2.x[j1],
              s2.y[j1])) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  cout << "NO\n";
  return 0;
}
