#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;

#define ll long long int
#define nl cout<<"\n";
#define pb push_back

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

int main(){
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
