#include<iostream>
using namespace std;
int main(){
  double 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)||(e<=a&&a<=g)||(e<=c&&c<=g))
     && ((b<=f&&f<=d)||(b<=h&&h<=d)||(f<=b&&b<=h)||(f<=d&&d<=h)) )cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}