#include<bits/stdc++.h>
using namespace std;
int main()
{
    int tst,i,m,n;
    cin>>tst;
    while(tst--)
    {
        int ar[4];
        cin>>ar[0]>>ar[1]>>ar[2]>>ar[3];
        n=max(ar[2],ar[3]);m=max(ar[0],ar[1]);
        sort(ar,ar+4);
        ((n==ar[3]||n==ar[2])&&(m==ar[3] || m==ar[2]))?cout<<"YES\n":cout<<"NO\n";
    }
}