#include<vector>
#include<iostream>
#include<string>
#include<utility>
using namespace std;

#define X first
#define Y second

const double eps =  1e-9;
typedef long double ld;
typedef pair<ld,ld> P;
typedef pair<P,P> S;

bool in(S a,P b){
  return 
    (a.first.X <= b.X && b.X <= a.second.X && a.first.Y <= b.Y && b.Y <= a.second.Y)
    ||(a.first.X <= b.X && b.X <= a.second.X && a.second.Y <= b.Y && b.Y <= a.first.Y)
    ||(a.second.X <= b.X && b.X <= a.first.X && a.first.Y <= b.Y && b.Y <= a.second.Y)
    ||(a.second.X <= b.X && b.X <= a.first.X && a.second.Y <= b.Y && b.Y <= a.first.Y);
}


int main(){
  S a,b;
  while(cin>>a.first.X >>a.first.Y >> a.second.X >>a.second.Y >> b.first.X >>b.first.Y >> b.second.X >>b.second.Y){
    if(in(a,P(b.first.X,b.first.Y))
        || in(a,P(b.first.X,b.second.Y))
        || in(a,P(b.second.X,b.first.Y))
        || in(a,P(b.second.X,b.second.Y))
        || in(b,a.first)
        || in(b,a.second)
        || in(b,P(a.first.X,a.second.Y))
        || in(b,P(a.second.X,a.first.Y))){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
}