#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
	string str = "";

	while (getline (cin, str ) ){

		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 ( max (ya1, ya2 ) < min (yb1, yb2 ) 
		  || min (ya1, ya2 ) > max (yb1, yb2 ) ){
			inter = false;
		} // end if

		if (inter){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
	} //  end while
		
	return 0;
}