#include <iostream>
#include <cstdio>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
bool judge(double *a) {
	if(a[1] < a[2]) return false;
	else if(a[0] > a[3]) return false;
	else return true;
}

int main() {
	double d;
	while(scanf("%lf", &d) != EOF) {
		double x[4], y[4];
		x[0] = d;
		rep(i,7) {
			if(i % 2) cin >> x[i/2+1];
			else cin >> y[i/2];
		}
		if(judge(x) && judge(y)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}