/**
 *   author:  wmlster
 *   created: 05.31.2021 11:37:16
**/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int s1,s2,s3,s4;
        cin>>s1>>s2>>s3>>s4;
        int maxi1=max(s1,s2);
        int maxi2=max(s3,s4);
        int a[4];
        a[0]=s1;
        a[1]=s2;
        a[2]=s3;
        a[3]=s4;
        sort(a,a+4);
        if(maxi1==a[2]&&maxi2==a[3]||maxi1==a[3]&&maxi2==a[2])
        {
            cout<<"YES\n";
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}
