#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(xc>xd)swap(xc,xd);
		if(ya>yb)swap(ya,yb);
		if(yc>yd)swap(yc,yd);
		
		double h1=yb-ya, h2=yd-yc, w1=xb-xa, w2=xd-xc;
		
		double cx1=(xa+xb)/2;
		double cx2=(xc+xd)/2;
		double cy1=(ya+yb)/2;
		double cy2=(yc+yd)/2;
		
		double dx = fabs(cx1-cx2);
		double dy = fabs(cy1-cy2);
		
		printf("%lf %lf   %lf %lf   %lf %lf  !!!\n",h1,w1,h2,w2,dx,dy);
		
		if(dx<(w1+w2)/2 && dy<(h1+h2)/2)puts("YES");
		else puts("NO");
	}
}