#include<iostream>
#include<algorithm>
using namespace std;
struct rec {
	double x1, y1, x2, y2;
	double minx = min(x1, x2);
	double maxx = max(x1, x2);
	double miny = min(y1, y2);
	double maxy = max(y1, y2);
};
int main() {
	rec s1, s2;
	while (cin >> s1.x1 >> s1.y1 >> s1.x2 >> s1.y2 >> s2.x1 >> s2.y1 >> s2.x2 >> s2.y2){
		if (!(s1.minx < s2.maxx)&&!(s2.minx < s1.maxx)){
			if (!(s1.miny < s2.maxy) && !(s2.miny < s1.maxy)){
				cout << "YES";
			}
			else cout << "NO";
		}
		else cout << "NO";
		cout << endl;
	}
	return 0;
}