#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
struct P{double x,y;};
int main(){
	P p[4];
	while(cin >> p[0].x >> p[0].y){
		bool flag = false;
		rep(i,3)cin >> p[i+1].x >> p[i+1].y;
		
		vector<P> data;
		rep(i,2){data.push_back(p[2+i]);}
		
		P t;
		t.x = p[2].x; t.y = p[3].y; data.push_back(t);
		t.x = p[3].x; t.y = p[2].y; data.push_back(t);
		
		rep(i,4){
			P cur = data[i];
			if( min(p[0].x , p[1].x) <= cur.x && cur.x <= max(p[0].x , p[1].x) ){
				if( min(p[0].y , p[1].y) <= cur.y && cur.y <= max(p[0].y , p[1].y) ){
					flag = true;
				}
			}
		}
		
		data.clear();
		rep(i,2){data.push_back(p[i]);}
		
		t.x = p[0].x; t.y = p[1].y; data.push_back(t);
		t.x = p[1].x; t.y = p[0].y; data.push_back(t);

		rep(i,4){
			P cur = data[i];
			if( min(p[2].x , p[3].x) <= cur.x && cur.x <= max(p[2].x , p[3].x) ){
				if( min(p[2].y , p[3].y) <= cur.y && cur.y <= max(p[2].y , p[3].y) ){
					flag = true;
				}
			}
		}
		
		cout << (flag?"YES":"NO") << endl;
		
	}
}
	