#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>

using namespace std;
int books[10010]={0};
int dp[10000][1000];

#define INF 999999
bool check();
double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
int main(){
	while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2)){
		(check()) ? puts("YES") : puts("NO");
	}
	return 0;
}
bool check(){
	bool x = min(xa1,xa2) <= max(xb1,xb2) && max(xa1,xa2) >= min(xb1,xb2);
	if(!x)return false;
	bool y = min(ya1, ya2) <= max(yb1, yb2) && max(ya1, ya2) >= min(yb1, yb2);
	if(!y)return false;
	return true;
}