#include <iostream>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--){
    int s1,s2,s3,s4;
    cin>>s1>>s2>>s3>>s4;
    int win1,win2;
    if(s1>s2)
        win1=s1;
    else
        win1=s2;
    if(s3>s4)
        win2=s3;
    else
        win2=s4;
    int skill[4]={s1,s2,s3,s4};
    for(int j=0;j<2;j++){
    for(int i=0;i<3;i++){
        if(skill[i]>skill[i+1]){
            int temp=skill[i+1];
            skill[i+1]=skill[i];
            skill[i]=temp;
        }
    }
    }
    if((win1==skill[2] || win1==skill[3]) && (win2==skill[2] || win2==skill[3]))
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    }
    return 0;
}
