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

#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define el "\n"
const ll mod=1000000007;
const ll MAX=1e6+5;
const ll INF=1e18;
const int MAX_CHAR=256;
#define all(v) v.begin(),v.end()


void solve() {
    int s1,s2,s3,s4;
    int val[4];
    cin >> s1 >> s2 >> s3 >> s4;
    val[0]=s1,val[1]=s2,val[2]=s3,val[3]=s4;
    sort(val,val+4,greater<int>());
    int t1=max(s1,s2), t2=max(s3,s4), t3=val[0],t4=val[1];
    if((t1==t3 && t2== t4) || (t1==t4 && t2==t3))
        cout << "YES\n";
    else
    {
        cout << "NO\n";
    }
    
}



int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    #ifndef ONLINE_JUDGE
        freopen ("output.txt","w",stdout);
        freopen("input.txt","r",stdin);
    #endif
    int tc=1,i;
    cin >> tc;
    for(i=1;i<=tc;i++) {
        //cout << "Case #" << i << ": ";
        solve();
    }
}

