// 2011/05/25 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
		cin >> xa1;
		if(cin.eof())
			break;
		cin >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2;

		double x1 = xa2-xb1;
		double x2 = xa1-xb2;
		double y1 = ya2-yb1;
		double y2 = ya1-yb2;

		if(x1*x2<=0.0&&y1*y2<=0.0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}