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



#define fast            ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fo(i,n)         for(i=0;i<n;i++)
#define foi(i,k,n)      for(i=k;i<n;i++)
#define wt              long t; cin>>t; while(t--)
#define ll              long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vl              vector<long>
#define vll             vector<long long>
#define mii             map<int,int>
#define pqi             priority_queue<int> 
#define pr(a)           cout<<a<<" ";
#define pra(a)          for(i=0;i<a.size();i++){cout<<a[i]<<" ";} 
#define pry             cout<<"YES\n"
#define prn             cout<<"NO\n"
#define endl             cout<<endl;
#define mod             1000000007
bool p[1000000]={0};
void primeFacTillN(long n)
{  
  p[0]=1;
  p[1]=1;
  int i=0;
  for(int i=2;i<=n;i++)
  {
    if(!p[i])
    {
      for(int j=2*i;j<=n;j+=i)
        p[j]=1;
    }
  }
 }




//base any number 

long long baseN(long long a,long long n){
if(a<n)
return a;
else{
return(a%n + 10*baseN((a/n),n));
}
}

ll binarySearch(ll a[],ll l,ll h, ll k)
{
  while(l<=h)
  {
    ll mid= (l+h)>>1;
    if(a[k]>mid)
      l=mid+1;
    else if (a[k]<mid)
      h=mid-1;
    else return mid;
  }
  return -1;
  
}

long long GCD(ll A, ll B) {
    if(B==0)
        return A;
    else
        return GCD(B, A % B);
}
void swap(ll *a, ll *b)
 {
  ll temp=*a;
  *a=*b;
  *b= temp;
 }
int main()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("outputhelp2.txt", "w", stdout);
#endif

wt
{
  ll a[4],b[4];
  ll i;
  for(i=0;i<4;i++)
    {cin>>a[i];
      b[i]=a[i];

    }

    sort(a, a+4);

    ll x = a[3];
    ll y = a[2];

    if((y==b[0] || y==b[1]) && (x==b[2]||x==b[3]))
      cout<<"YES\n";
    else if ((x==b[0] || x==b[1]) && (y==b[2]||y==b[3]))
      cout<<"YES\n";
    else cout<<"NO\n";
}
return 0;
}


