#include <iostream>
#include <cstdio>

using namespace std;

int main(){
	double ax, ay, bx, by, cx, cy, dx, dy;
	while( scanf(" %lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &dx, &dy) != EOF ){
		bool flag=false;
		
		if( (ax<=cx && cx<=bx) || (ax<=dx && dx<=bx) ){
			if( (ay<=cy && cy<=by) || (ay<=dy && dy<=by) ){
				flag = true;
			}
		}
		
		if( (cx<=ax && ax<=cx) || (cx<=bx && bx<=dx) ){
			if( (cy<=ay && ay<=dy) || (cy<=by && by<=dy) ){
				flag = true;
			}
		}
		
		if(flag) printf("YES\n");
		else printf("NO\n");
	
	}


	return 0;
}