#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=10;
int a[N];
int n,i,m1,m2;
int main(){
  /*ios_base::sync_with_stdio(false);
      cin.tie(0);
      cout.tie(0);
      #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
      #endif*/
    int T;cin>>T;
    while(T--){
      for(i=0;i<4;i++){
        cin>>a[i];
      }
      m1=max(a[0],a[1]);
      m2=max(a[2],a[3]);
      sort(a,a+4);
      if((m1==a[3] && m2==a[2]) || (m1==a[2] && m2==a[3])){
        cout<<"YES"<<endl;
        continue;
      }
      cout<<"NO"<<endl;
    }
}