#include <iostream>
#include <cmath>
using namespace std;
int main(){
	double a[8];
	while(cin >> a[0]){
		for(int i=1;i<8;i++) cin >> a[i];
		bool b = true;
		if(a[0]>a[6]) b = false;
		if(a[1]>a[7]) b = false;
		if(a[4]>a[2]) b = false;
		if(a[5]>a[3]) b = false;
		if(b) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}