#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define RFOR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EPS 1e-15

using namespace std;

typedef complex<double> point;
typedef vector<point> polygon;
typedef pair<int, int> paii;
typedef long long ll;

double dot(point va, point vb){
	return real(va) * real(vb) + imag(va) * imag(vb);
}

double cross(point va, point vb){
	return real(va) * imag(vb) - imag(va) * real(vb);
}

double distance_l_p(point a, point b, point c){
	return abs(cross(b - a, c - a)) / abs(b - a);
}

double distance_ls_p(point a, point b, point c){
	if( dot(b - a, c - a) <= 0.0 ) return abs(c - a);
	if( dot(a - b, c - b) <= 0.0 ) return abs(c - b);
	return distance_l_p(a, b, c);
}

bool contains(polygon plg, point pt){
	int cnt = 0;
	double y = imag(pt);

	for(int i = 0; i < plg.size(); ++i){
		int j = (i + 1 == plg.size() ? 0: i + 1);

		if( distance_ls_p(plg[i], plg[j], pt) <= EPS ){
			return true;
		}

		double dyi = imag(plg[i]) - y;
		double dyj = y - imag(plg[j]);
		double tx = (dyi * real(plg[j]) + dyj * real(plg[i])) / (dyi + dyj);

		if(imag(plg[i]) >= y && imag(plg[j]) < y){
			if( tx < real(pt) ) ++cnt;
		}
		else if(imag(plg[i]) < y && imag(plg[j]) >= y){
			if( tx < real(pt) ) ++cnt;
		}
	}
	
	return (cnt % 2 != 0);
}

bool intersected(point pa1, point pa2, point pb1, point pb2){
	double a = cross(pa2 - pa1, pb1 - pa1);
	double b = cross(pa2 - pa1, pb2 - pa1);
	double c = cross(pb2 - pb1, pa1 - pb1);
	double d = cross(pb2 - pb1, pa2 - pb1);

	if( (a < -EPS && b > EPS) || (b < -EPS && a > EPS) ){
		if( (c < -EPS && d > EPS) || (d < -EPS && c > EPS) ){
			return true;
		}
	}
	
	if( 	distance_ls_p(pa1, pa2, pb1) < EPS
		 || distance_ls_p(pa1, pa2, pb2) < EPS
		 || distance_ls_p(pb1, pb2, pa1) < EPS
		 || distance_ls_p(pb1, pb2, pa2) < EPS
	){
		return true;
	}	
	
	return false;
}

int contact(polygon plg1, polygon plg2){
	int n = plg1.size();
	int m = plg2.size();

	for(int i = 0; i < n; ++i){
		for(int j = 0; j < m; ++j){
			if( intersected(plg1[i], plg1[(i+1)%n], plg2[j], plg2[(j+1)%m]) ){
				return 1;
			}
		}
	}
	
	if( contains(plg1, plg2[0]) ){
		return -1;
	}
	if( contains(plg2, plg1[0]) ){
		return -2;
	}
	
	return 0;
}

int main()
{
	double arg[8];
	
	while( cin >> arg[0], !cin.eof())
	{
		FOR(i, 1, 8)
		{
			cin >> arg[i];
		}
		
		polygon plg1, plg2;
		
		plg1.push_back(point(arg[0], arg[1]));
		plg1.push_back(point(arg[0], arg[3]));
		plg1.push_back(point(arg[2], arg[1]));
		plg1.push_back(point(arg[2], arg[3]));
		plg2.push_back(point(arg[4], arg[5]));
		plg2.push_back(point(arg[4], arg[7]));
		plg2.push_back(point(arg[6], arg[5]));
		plg2.push_back(point(arg[6], arg[7]));
		
		int con = contact(plg1, plg2);
		
		cout << (con != 0 ? "YES" : "NO") << endl;
	}
		
	return 0;
}