#include <stdio.h>

int main(void){
	double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
	int cnt;

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF){
		cnt = 0;
		if(xb1 <= xa2 && xb1 >= xa1 && yb2 >= ya1 && yb2 <= ya2) cnt++; 
		if(xb1 <= xa2 && xb1 >= xa1 && yb1 >= ya1 && yb1 <= ya2) cnt++; 
		if(xb2 <= xa2 && xb2 >= xa1 && yb1 >= ya1 && yb1 <= ya2) cnt++; 
		if(xb2 <= xa2 && xb2 >= xa1 && yb2 >= ya1 && yb2 <= ya2) cnt++;

		if(cnt > 0){
			if(cnt == 4 && !(xa1 == xb1 || xa2 == xb2 || ya1 == yb1 || ya2 == yb2)){
				printf("NO\n");
			}else{
				printf("YES\n");
			}
		}else{
			printf("NO\n");
		}
	}

	return 0;
}