//Intersection of Rectangles
#include<bits/stdc++.h>
using namespace std;

bool a(int l, int m, int r){
  if(l<=m && m<=r)return true;
}

int main(){
  complex<double> a1, a2, b1, b2;
  while(cin>>a1.real()>>a1.imag()>>a2.real()>>a2.imag()>>b1.real()>>b1.imag()>>b2.real()>>b2.imag()){
    double maxx=max(a1.real(), a2.real()), minx=min(a1.real(), a2.real());
    double maxy=max(a1.imag(), a2.imag()), miny=min(a1.imag(), a2.imag());
    if((a(minx, b1.real(), maxx)||a(minx, b2.real(), maxx)) && (a(miny, b1.imag(), maxy)||a(miny, b2.imag(), maxy)))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}