#include <iostream>
#include <algorithm>

using namespace std;

int main(){
        double x[8];
        while(cin >> x[0]){
                for(int i = 1 ; i < 8; i++) cin >> x[i];
                bool flag = false;
                for(int i = 0; i < 2; i++){
                        if(max(x[0+i], x[2+i]) < min(x[4+i], x[6+i]) || max(x[4+i], x[6+i]) < min(x[0+i],x[2+i])){
                                flag = true;
                        }   
                }   
                if(flag) cout << "NO";
                else cout << "YES";
                cout << endl;
        }   
}