#include <iostream>
#include <complex>
using namespace std;
const double EPS = 1e-10;
typedef complex<double> P;

bool ior1(double x, double y, double z)
{
  return x < y + EPS && y < z + EPS;
}

bool ior(P a1, P a2, P b1, P b2)
{
  bool res;
  if (a1.real() < b1.real())
    res = ior1(a1.real(), b1.real(), a2.real());
  else
    res = ior1(b1.real(), a1.real(), b2.real());
  if (res) {
    if (a1.imag() < b1.imag())
      return ior1(a1.imag(), b1.imag(), a2.imag());
    else
      return ior1(b1.imag(), a1.imag(), b2.imag());
  }
  return false;
}

int main(int argc, char **argv)
{
  double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
  while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) {
    if (ior(P(xa1, ya1), P(xa2, ya2), P(xb1, yb1), P(xb2, yb2)))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}