#include <iostream>
using namespace std;

double x1, x2, x3, x4, y1, y2, y3, y4;
bool check1(double x, double y)
{
	return x1<=x && x<=x2 && y1<=y && y<=y2;
}
bool check2(double x, double y)
{
	return x3<=x && x<=x4 && y3<=y && y<=y4;
}

int main()
{
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4)
	{
		if (check1(x3, y3) || check1(x3, y4) || check1(x4, y3) || check1(x4, y4)
		||  check2(x1, y1) || check2(x1, y2) || check2(x2, y1) || check2(x2, y2))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}