import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

bool inside(real[] a, real x, real y)
{
    return a[0]<=x && x<=a[2] && a[1]<=y && y<=a[3];
}
bool overrap(real[] a, real[] b)
{
    foreach(_;0..2)
    {
        foreach(i;0..2) foreach(j;0..2)
            if(inside(a,b[i*2],b[j*2+1]))
                return true;
        swap(a,b);
    }
    return false;
}

void main()
{
    foreach(s;stdin.byLine())
    {
        auto m = s.split().map!(to!real).array();
        writeln(overrap(m[0..4], m[4..$])?"YES":"NO");
    }
}