#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int main(){
	
	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
		if(xa>xb)swap(xa,xb);
		if(ya>yb)swap(ya,yb);
		
		if(xc>xd)swap(xc,xd);
		if(yc>yd)swap(yc,yd);
		
		//printf("((%.3lf %.3lf)(%.3lf %.3lf))  ((%.3lf %.3lf)(%.3lf %.3lf))\n",xa,ya,xb,yb,xc,yc,xd,yd);
		
		bool xin = (xa<xd && xb>=xc) || (xc<xb && xd>=xa);
		bool yin = (ya<yd && yb>=yc) || (yc<yb && yd>=ya);
		
		if(xin&&yin)puts("YES");
		else puts("NO");
	}
}