#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){
        bool x=!(max(xA,xB)+EPS < min(xC,xD) ||
                 max(xC,xD)+EPS < min(xA,xB));
        bool y=!(max(yA,xB)+EPS < min(yC,yD) ||
                 max(yC,yD)+EPS < min(yA,yB));
        cout<<( x&&y ? "YES" : "NO")<<endl;
    }
}