#include <iostream>

using namespace std;

struct Point {
    double x, y;
};

bool is_in(Point a1, Point a2, Point b1, Point b2) {
    Point r[4];
    r[0].x = b1.x;
    r[0].y = b2.y;
    r[1] = b2;
    r[2] = b1;
    r[3].x = b2.x;
    r[3].y = b1.y;
    for (int i = 0; i < 4; i++) {
        if (a1.x <= r[i].x && r[i].x <= a2.x && a2.y <= r[i].y && r[i].y <= a1.y) {
            return true;
        }
    }
    return false;
}

int main() {
    while (1) {
        Point src[4];
        for (int i = 0; i < 4; i++) {
            if (!(cin >> src[i].x >> src[i].y)) {
                return 0;
            }
        }
        if (is_in(src[0], src[1], src[2], src[3]) || is_in(src[2], src[3], src[0], src[1])) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }

    return 0;
}