#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
const int dx[4]={0,0,1,1};
const int dy[4]={0,1,0,1};
int main(void){
  double x[4],y[4];
  while(cin>>x[0]>>y[0]){
    FOR(i,1,4)cin>>x[i]>>y[i];
    double px,py;
    bool out=false;
    REP(r,4){
      px = x[0+dx[r]]; py = y[0+dy[r]];
      if(x[2]<=px&&px<=x[3]&&y[2]<=py&&py<=y[3])out = true;
    }
    REP(r,4){
      px = x[2+dx[r]]; py = y[2+dy[r]];
      if(x[0]<=px&&px<=x[1]&&y[0]<=py&&py<=y[1])out = true;
    }
    if(x[0]<=x[2]&&x[3]<=x[1]&&y[2]<=y[0]&&y[1]<=y[3])out=true;
    if(x[2]<=x[0]&&x[1]<=x[3]&&y[0]<=y[2]&&y[3]<=y[1])out=true;
    if(out)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}