#include <iostream>
using namespace std;

int main(void){
  float a,b,c,d,e,f,g,h;

  while(cin>>a>>b>>c>>d>>e>>f>>g>>h){
    if(((a<=e && e<=c || a<=g && g<=c) && (b<=f && f<=d || b<=h && h<=d))
     ||((e<=a && a<=g || e<=c && c<=g) && (f<=b && b<=h || f<=d && d<=h))){
      cout<<"YES\n";
    }
    else{
      cout<<"NO\n";
    }
  }

  return 0;
}