#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
using namespace std;



int main(){
	double x[4],y[4],big,sml;
	bool a,b;
	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]) != EOF){
		if(x[0]<x[1]){
			big = x[1];
			sml = x[0];
		}
		else{
			big = x[0];
			sml = x[1];
		}
		if( (x[2]<=big && x[2]>=sml) || (x[3]<=big && x[3]>=sml) ) a = true;
		else a = false;
		
		if(y[0]<y[1]){
			big = y[1];
			sml = y[0];
		}
		else{
			big = y[0];
			sml = y[1];
		}
		if( (y[2]<=big && y[2]>=sml) || (y[3]<=big && y[3]>=sml) ) b = true;
		else b = false;
		
		if(a&&b) printf("YES\n");
		else printf("NO\n");
	}
			
	return 0;
}
