#include<bits/stdc++.h>
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((e<=a&&a<=g)||(e<=c&&c<=g)){
			if((f<=d&&d<=h)||(f<=b&&b<=h)){
				cout<<"YES"<<endl;
				}
				else cout<<"NO"<<endl;
			}
		
		else if((a<=e&&e<=c)||(a<=g&&g<=c)){
			if((b<=f&&f<=d)||(b<=h&&h<=d)){
				cout<<"YES"<<endl;
				}
				else cout<<"NO"<<endl;
			}	
		else cout<<"NO"<<endl;	
		}
		return 0;
	}