#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define fl(i,a,n) for(ll i=a;i<n;i++)
#define rl(i,n,a) for(ll i=n;i>=a;i--)
// int n,m;
 // int dr[]={-1,1,0,0};
 // int dc[]={0,0,-1,1};
 // std::vector<char> v[100];

void solve() {
  ll s[4];
  fl(i,0,4) cin>>s[i];
  ll a=max(s[0],s[1]);
  ll b=max(s[2],s[3]);
  sort(s,s+4);
  ll c=s[2];
  if(c==a||c==b) cout<<"YES\n";
  else cout<<"NO\n";
}

int main() {
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  #endif
    int t=1;cin>>t;
   while(t--){
    solve();
   }
    return 0;
}
