#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int a[4];
        for(int i=0;i<4;i++){
            cin>>a[i];
        }
        int flag=0;
        int firstmax=max(a[0],a[1]);
        int secondmax=max(a[2],a[3]);
        sort(a,a+4);
        if(firstmax==a[2] || firstmax==a[3]){
            flag++;
        }
        if(secondmax==a[2] || secondmax==a[3]){
            flag++;
        }
        if(flag==2){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}