#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
using namespace std;

bool intersects(double a, double b, double c, double d) {
    bool result = true;
    if ( (a < c && b < c) || (a > d && b > d) ) result = false;

    return result;
}

int main() {

    double a, b, c, d, e, f, g, h;
    while(cin >> a >> b >> c >> d >> e >> f >> g >> h) {
        if ( intersects(a, c, e, g) && intersects(b, d, f, h) ) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
     
    return 0;
}