#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

const double EPS = 1e-10;

typedef vector<int> vi;

int main()
{
	double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF){
		bool x = min(xa1, xa2) < max(xb1, xb2) && max(xa1, xa2) > min(xb1, xb2);
		bool y = min(ya1, ya2) < max(yb1, yb2) && max(ya1, ya2) > min(yb1, yb2);
		puts(x&&y ? "YES" : "NO");
	}

	return 0;
}