#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

int main() {
  float a[4], b[4];
  while (scanf("%f",a) != -1) {
    for(int i=1;i<4;++i) scanf("%f",a+i);
    rep(i,4) scanf("%f",b+i);
    float ax[4], ay[4], bx[4], by[4];
    
    ax[0] = a[0], ay[0] = a[1];
    ax[1] = a[2], ay[1] = a[3];
    ax[2] = a[2], ay[2] = a[1];
    ax[3] = a[0], ay[3] = a[3];
    
    bx[0] = b[0], by[0] = b[1];
    bx[1] = b[2], by[1] = b[3];
    bx[2] = b[2], by[2] = b[1];
    bx[3] = b[0], by[3] = b[3];

    bool ok = false;
    rep(i,4) {
      if(a[0] <= bx[i] && bx[i] <= a[2] &&
         a[1] <= by[i] && by[i] <= a[3] ) {
        ok = true;
      }
      if(b[0] <= ax[i] && ax[i] <= b[2] &&
         b[1] <= ay[i] && ay[i] <= b[3]) {
        ok = true;
      }
    }
    printf("%s\n", ok?"YES":"NO");
  }
  return 0;
}