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

bool cross(real[] a, real[] b, int y)
{
    a=a[y..$];b=b[y..$];
    foreach(_;0..2)
    {
        foreach(i;0..2)
            if(a[0]<=b[i*2] && b[i*2]<=a[2])
                return true;
        swap(a,b);
    }
    return false;
}
bool overrap(real[] a, real[] b)
{
    return cross(a,b,0) && cross(a,b,1);
}

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