#include<iostream>
#include<vector>
#include<string>
#define int double
using namespace std;

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