import std.stdio;
import std.conv;
import std.algorithm;
import std.array;
import std.string;
import std.uni;
import std.math;
import std.container.rbtree;
import std.range;
import std.numeric;

void main()
{
    auto t = to!long(readln().chomp);
    OUTER: foreach(_; 0..t)
    {
        auto arr = readln().chomp.splitter(" ").map!(to!long).array;
        auto rev = arr.retro.array;
        
        if(arr[0] > arr[2] && arr[1] > arr[2] && arr[0] > arr[3] && arr[1] > arr[3])
            writeln("NO");
        else if(rev[0] > rev[2] && rev[1] > rev[2] && rev[0] > rev[3] && rev[1] > rev[3])
            writeln("NO");
        else
            writeln("YES");
    }
}