#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.inter", "r", stdin);
	string str = "";
	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
		stringstream ss(str);
		ss >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2;
		bool inter = true; 

		if ( max (xa1, xa2 ) < min (xb1, xb2 ) 
 		  || min (xa1, xa2 ) > max (xb1, xb2 ) ){
			inter = false;
		}else{
			if ( min (ya1, ya2 ) > max (yb1, yb2 ) 
			  || max (ya1, ya2 ) < min (yb1, yb2 ) ){
				inter = false;
			} // end if
		} // end if
		if (inter){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
	} //  end while
		
	return 0;
}