#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main() {
	vector<double>a(8);
	while (1) {
		for (int b = 0; b < 8; b++)cin >> a[b];
		if (cin.fail())break;
		if (a[0] <= a[4] && a[2] >= a[4] && a[1] <= a[5] && a[3] >= a[5])cout << "YES" << endl;
		else if (a[0] <= a[4] && a[2] >= a[4] && a[1] <= a[7] && a[3] >= a[7])cout << "YES" << endl;
		else if (a[0] <= a[6] && a[2] >= a[6] && a[1] <= a[5] && a[3] >= a[5])cout << "YES" << endl;
		else if (a[0] <= a[6] && a[2] >= a[6] && a[1] <= a[7] && a[3] >= a[7])cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}