#include<iostream>
using namespace std;
long double a1, a2, b1, b2, c1, c2, d1, d2;
int main() {
	while (cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2 >> d1 >> d2) {
		if (((d1 - a1) < 1e-10 || (b1 - c1) < 1e-10) || ((d1 - a1) < 1e-10 || (b1 - c1) < 1e-10)) { cout << "NO" << endl; }
		else { cout << "YES" << endl; }
	}
}