#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <sstream>
#include <climits>
#include <cmath>
#include <map>
#include <stack>
using namespace std;
#define M_PI 3.141592
#define toRad 2.0*M_PI/360.0
#define inin(x) int x;cin>>x;
#define all(x) x.begin(),x.end()
#define debug(x) cout<<#x<<" "<<x<<endl;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define EPS 1e-12
#define pri_max 60000
typedef pair<double, double> pdd;
/*
bool memo[pri_max] = {};
vector<int> pri;
void calc()
{
	for (int i = 2; i < pri_max; i++)
	{
		if (memo[i] == false)
		{
			pri.push_back(i);
			for (int l = i; l < pri_max; l += i)
			{
				memo[l] = true;
			}
		}
	}
}*/
int main()
{
	pdd a[4];
	while (cin >> a[0].first >> a[1].second)
	{
		for (int i = 1; i < 4; i++) cin >> a[i].first >> a[i].second;
		bool flag = false;
		for (int k = 0; k < 2; k++)
		{
			vector<pdd> x;
			x.push_back(a[2]);
			x.push_back(a[3]);
			x.push_back(pdd(a[2].first, a[3].second));
			x.push_back(pdd(a[3].first, a[2].second));
			for (int i = 0; i < x.size(); i++)
			{
				if (((a[0].first <= x[i].first&&x[i].first <= a[1].first)||fabs(a[0].first-x[i].first)<=EPS|| fabs(a[1].first - x[i].first) <= EPS)
					&&( (a[0].second <= x[i].second&&x[i].second <= a[1].second) || fabs(a[0].second - x[i].second) <= EPS || fabs(a[1].second - x[i].second) <= EPS))				
				{
					flag = true;
				}
			}
			swap(a[0], a[2]);
			swap(a[1], a[3]);
		}
		cout << (flag ? "YES" : "NO") << endl;
	}
}