#include <stdio.h>
#include <algorithm>
#include <math.h>
#include<cstdio>
 
using namespace std;
 
int main(){
 
    double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
    double a_bottom,a_top,a_left,a_right,b_top,b_bottom,b_left,b_right;
 
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2)!=EOF){
        a_bottom = ya1;
        a_left = xa1;
        a_top = ya2;
        a_right = xa2;
 
        b_bottom = yb1;
        b_left = xb1;
        b_top = yb2;
        b_right = xb2;
 
        if(((a_right >= b_left && a_right <= b_right)||(b_right >= a_left && b_right <= a_right))
                &&((b_top >= a_bottom && b_top <= a_top)|| (a_top >= b_bottom && a_top <= b_top))){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}
