#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
	while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2){
		if (min(xa1, xa2) <= xb1&&xb1 <= max(xa1, xa2) || min(xa1, xa2) <= xb2 && xb2 <= max(xa1, xa2))
			if (min(ya1, ya2) <= yb1&&yb1 <= max(ya1, ya2) || min(ya1, ya2) <= yb2 && yb2 <= max(ya1, ya2))
				cout << "YES";
			else cout << "NO";
		else cout << "NO";
	}
	return 0;
}