#include<iostream>
#include<algorithm>
using namespace std;
struct rec {
	double x1, y1, x2, y2;
	double minx;
	double maxx;
	double miny;
	double maxy;
};
int main() {
	rec s1, s2;
	while (cin >> s1.x1 >> s1.y1 >> s1.x2 >> s1.y2 >> s2.x1 >> s2.y1 >> s2.x2 >> s2.y2){
		s1.minx = min(s1.x1, s1.x2);
		s1.maxx = max(s1.x1, s1.x2);
		s2.minx = min(s2.x1, s2.x2);
		s2.maxx = max(s2.x1, s2.x2);
		s1.miny = min(s1.y1, s1.y2);
		s1.maxy = max(s1.y1, s1.y2);
		s2.miny = min(s2.y1, s2.y2);
		s2.maxy = max(s2.y1, 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;
}