#include<iostream>
#include<cstdio>
using namespace std;
signed main(){
	double x1,y1,x2,y2,x3,y3,x4,y4;
	while( scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF ){
		if(max(x1,x2) < min(x3,x4) || min(x1,x2) > max(x3,x4) || max(y1,y2) < min(y3,y4) || min(y1,y2) > max(y3,y4)) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}