#include<iostream>
using namespace std;
int main()
{
	double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
	while(cin>>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2)
	{
		double xl=min(xa1,xa2),xh=max(xa1,xa2);
		double yl=min(ya1,ya2),yh=max(ya1,ya2);

		pair<double,double> a,b,c,d;
		a.first=xb1; a.second=yb1;
		b.first=xb2; b.second=yb1;
		c.first=xb2; c.second=yb2;
		d.first=xb1; d.second=yb2;

		if(xl<=a.first&&a.first<=xh&&yl<=a.second&&a.second<=yh) cout<<"YES"<<endl;
		else if(xl<=b.first&&b.first<=xh&&yl<=b.second&&b.second<=yh) cout<<"YES"<<endl;
		else if(xl<=c.first&&c.first<=xh&&yl<=c.second&&c.second<=yh) cout<<"YES"<<endl;
		else if(xl<=d.first&&d.first<=xh&&yl<=d.second&&d.second<=yh) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
  return 0;
}