#include<cstdio>
#include<algorithm>

using namespace std;

double x[4],y[4];
int main(void){
	while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])){
		
		if(x[0]>x[2]){
			swap(x[1],x[3]);
			swap(y[1],y[3]);
			swap(y[0],y[2]);
			swap(x[0],x[2]);
		}
		
		if(x[1]<x[2])printf("NO\n");
		else{
			if(y[0]>y[3] || y[2]>y[1])printf("NO\n");
			else printf("YES\n");
		}
	}
}