#include <bits/stdc++.h>

using namespace std;

struct Point { double x, y; };

int main() {
    Point p[4];
    while (scanf("%lf %lf", &p[0].x, &p[0].y) != EOF) {
        for (int i = 1; i < 4; i++)
            scanf("%lf %lf", &p[i].x, &p[i].y);
        
        if (!((p[1].x < p[2].x) || (p[3].x < p[0].x)) && !((p[1].y < p[2].y) || (p[3].y < p[0].x)))
            puts("YES");
        else
            puts("NO");
    }

    return 0;
}
