#include <cstdio>
#include <vector>
#include <utility>
using namespace std;

typedef std::pair<float, float> P;

struct Bound {
  float mnX, mnY, mxX, mxY;
};

float f[10];

Bound createLhsBound() {
  const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
  return (Bound){mnX, mnY, mxX, mxY};
}

Bound createRhsBound() {
  const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
  return (Bound){mnX, mnY, mxX, mxY};
}

vector<P> create(float mnX, float mnY, float mxX, float mxY) {
  vector<P> v;
  const float lx[2] = {mnX, mxX};
  const float ly[2] = {mnY, mxY};
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      v.push_back(P(lx[i], ly[j]));
  return v;
}

vector<P> createLhs() {
  const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
  return create(mnX, mnY, mxX, mxY);
}

vector<P> createRhs() {
  const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
  return create(mnX, mnY, mxX, mxY);
}

bool isLess(float l, float r) {
  if ((l - (1e-11)) < r)
    return true;
  return false;
}

int solve() {
  Bound lhsBound = createLhsBound(), rhsBound = createRhsBound();
  vector<P> lhs = createLhs(), rhs = createRhs();

  for (int i = 0; i < 4; ++i) {
    P cur = lhs[i];
    if (isLess(rhsBound.mnX, cur.first) &&
        isLess(cur.first, rhsBound.mxX) &&
        isLess(rhsBound.mnY, cur.second) &&
        isLess(cur.second, rhsBound.mxY))
      return 1;
  }

  for (int i = 0; i < 4; ++i) {
    P cur = rhs[i];
    if (isLess(lhsBound.mnX, cur.first) &&
        isLess(cur.first, lhsBound.mxX) &&
        isLess(lhsBound.mnY, cur.second) &&
        isLess(cur.second, lhsBound.mxY))
      return 1;
  }

  return 0;
}

int main() {
  float check;
  while (scanf("%f", &check) != -1) {
    f[0] = check;
    for (int i = 1; i < 8; ++i)
      scanf("%f", f + i);
    printf("%s\n", solve() ? "YES" : "NO");
  }
  return 0;
}