#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>


using namespace std;

int tri_sum(double x1, double y1, double x2, double y2, double x3, double y3 ){
    double tri1 = fabs(y1-y2)*fabs(x1-x3)/2;
    double tri2 = fabs(y1-y2)*fabs(x2-x3)/2;
    
    double tri3 = fabs(x1-x2)*fabs(y1-y3)/2;
    double tri4 = fabs(x1-x2)*fabs(y2-y3)/2;
    
    double squ = fabs(x1-x2)*fabs(y1-y2);
    
    if(squ == tri1+tri2+tri3+tri4)return 0;
    else return 1;
}

int main(){
    
    double xA, yA, xB, yB, xC, yC, xD, yD;
    while(cin>>xA>>yA>>xB>>yB>>xC>>yC>>xD>>yD){
        int ans=0;
        if(xA>=xC&&yA>=yC&&xB<=xD&&yB<=yD){
            cout<<"YES"<<endl;
        }else{
            ans+=tri_sum(xA, yA, xB, yB, xC, yC);
            ans+=tri_sum(xA, yA, xB, yB, xD, yC);
            ans+=tri_sum(xA, yA, xB, yB, xC, yD);
            ans+=tri_sum(xA, yA, xB, yB, xD, yD);
            if(ans==4)cout<<"NO"<<endl;
            else cout<<"YES"<<endl;
        }
        
    }
}