#include <iostream>
#include <cmath>
#include <complex>
#include <vector>

using namespace std;

const double EPS = 1e-10;

int main(){
    double xA,yA,xB,yB,xC,yC,xD,yD;
    while(cin>>xA>>yA>>xB>>yB>>xC>>yC>>xD>>yD){
        typedef pair<double,double> P;
        bool x=!(max(xA,xB)<min(xC,xD) || max(xC,xD)<min(xA,xB));
        bool y=!(max(yA,xB)<min(yC,yD) || max(yC,yD)<min(yA,yB));
        cout<<( x&&y ? "YES" : "NO")<<endl;
    }
}