#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": # "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

const double EPS=1e-10;

typedef complex<double> point; // x,y
typedef pair<point,point> line; // pos,dir

int signum(double x)
{
	return abs(x)<EPS?0:x>0?1:-1;
}

double dot(const point& a,const point& b)
{
	return (a*conj(b)).real();
}

double cross(const point& a,const point& b)
{
	return (a*conj(b)).imag();
}

int ccw(const line& l,const point& p)
{
	point d1=l.second;
	point d2=p-l.first;
	double res=cross(d1,d2);
	if(signum(res))
		return signum(res);
	if(signum(dot(d1,d2))==-1) // c-a-b
		return +2;
	if(signum(norm(d2)-norm(d1))==1) // a-b-c
		return -2;
	return 0; // a-c-b
}

bool intersect_ls(const line& l,const line& s)
{
	point p1=s.first;
	point p2=s.first+s.second;
	int res=ccw(l,p1)*ccw(l,p2);
	return res==-1 || res==0;
}

bool intersect_ss(const line& a,const line& b)
{
	return intersect_ls(a,b) && intersect_ls(b,a);
}

bool intersect(double x[],double y[])
{
	point p1[4]={point(x[0],y[0]),point(x[1],y[0]),point(x[1],y[1]),point(x[0],y[1])};
	point p2[4]={point(x[2],y[2]),point(x[3],y[2]),point(x[3],y[3]),point(x[2],y[3])};
	line l1[4];
	line l2[4];
	rep(i,4){
		l1[i]=line(p1[i],p1[(i+1)%4]-p1[i]);
		l2[i]=line(p2[i],p2[(i+1)%4]-p2[i]);
	}
	rep(i,4)
		rep(j,4)
			if(intersect_ss(l1[i],l2[j]))
				return true;
	return false;
}

bool le(double a,double b)
{
	return a<b+1e-10;
}

bool between(double a,double b,double c)
{
	return le(a,b) && le(b,c);
}

string solve(double x[],double y[])
{
	int xi[]={0,1,0,1};
	int yi[]={0,0,1,1};
	rep(k,4)
		//if(le(x[2],x[xi[k]]) && le(x[xi[k]],x[3]) && le(y[2],y[yi[k]]) && le(y[yi[k]],y[3]))
		if(between(x[2],x[xi[k]],x[3]) && between(y[2],y[yi[k]],y[3]))
			return "YES";
	rep(k,4){
		xi[k]+=2;
		yi[k]+=2;
	}
	rep(k,4)
		//if(le(x[0],x[xi[k]]) && le(x[xi[k]],x[1]) && le(y[0],y[yi[k]]) && le(y[yi[k]],y[1]))
		if(between(x[0],x[xi[k]],x[1]) && between(y[0],y[yi[k]],y[1]))
			return "YES";
	if(intersect(x,y))
		return "YES";
	return "NO";
}

int main()
{
	for(double x[4],y[4];cin>>x[0]>>y[0];){
		repi(i,1,4)
			cin>>x[i]>>y[i];
		cout<<solve(x,y)<<endl;
	}
	
	return 0;
}