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

signed main() {
	while (1) {
		vector<int>a(8);
		for (int b = 0; b < 8; 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]) && (a[4]<a[0] || a[4]>a[2] || a[7]<a[1] || a[7]>a[3]) && (a[6]<a[0] || a[6]>a[2] || a[5]<a[1] || a[5]>a[3]) && (a[6]<a[0] || a[6]>a[2] || a[7]<a[1] || a[7]>a[3]))cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}