#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <memory.h>
#include <cassert>
#include <iomanip>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;

inline double dot(const P &a, const P &b) {
	return (conj(a) * b).real();
}

bool is_rect(P a[2], P b[2]) {
	double a_l = min(a[0].real(), a[1].real());
	double a_r = max(a[0].real(), a[1].real());
	double b_l = min(b[0].real(), b[1].real());
	double b_r = max(b[0].real(), b[1].real());
	double a_d = min(a[0].imag(), a[1].imag());
	double a_u = max(a[0].imag(), a[1].imag());
	double b_d = min(b[0].imag(), b[1].imag());
	double b_u = max(b[0].imag(), b[1].imag());
	if(a_l > b_r || a_r < b_l || a_d > b_u || a_u < b_d) return false;
	return true;
}

int main() {
	for (double x, y; cin >> x >> y; ) {
		P a[2], b[2];
		a[0] = P(x, y);
		rep(i, 3) {
			double x, y; cin >> x >> y;
			if (i == 0) a[1] = P(x, y);
			else b[i - 1] = P(x, y);
		}
		if (is_rect(a, b)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}