#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define ffi(x,y) for(long long int i=x;i<y;i++)
#define ffj(x,y) for(long long int j=x;j<y;j++)
#define frj(x,y) for(long long int j=x-1;j>=y;j--)
#define fri(x,y) for(long long int i=x-1;i>=y;i--)
#define pb(x) push_back(x)
#define pob(x) pop_back(x)
#define stv(v) sort(v.begin(),v.end())// Sort Vector
#define stvc(v,comp) sort(v.begin(),v.end(),comp) // Sort Vector using comp
#define vpb(Y) ll x;cin>>x;Y.pb(x) // vector Y pushback 
#define tc ll t;t=readInt();while(t--)
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define vvll vector<vector<ll>>
#define ve(x,y) vector<x> y
#define v2d(x,y,n,m) vector<vector<x>> y(n,vector<x>(m)) 
#define ts typedef struct
#define all(A) A.begin(),A.end()
#define MAXN 100005
#define MOD 1000000007

ll get_min(ll a, ll b)
{
    return (a>=b?b:a) ;
}

ll get_max(ll a, ll b)
{
    return (a>=b?a:b) ;
}
// Comparator for sort vector of pairs ascending wrt second element
// By default first element
bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
    return (a.second<b.second);
}
/* FASTER INPUT OUTPUT */

int readInt () {
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}

// //This is faster but maynot work on windows based compiler
// inline int readInt()
//     {
//     int noRead=0;
//     //@ts-ignore
//     char p=getchar_unlocked();
//     for(;p<33;){p=getchar_unlocked();};
//     while(p>32)
//     {
//     noRead = (noRead << 3) + (noRead << 1) + (p - '0');
//     p=getchar_unlocked();
//     }
//     return noRead;
//     };
void fill(){
    return ;
}

void test_case(){
    vll v(4);
    cin>>v[0]>>v[1]>>v[2]>>v[3];

    vll w = v;
    sort(all(v));

    ll a = max(w[0],w[1]);
    ll b = max(w[2], w[3]);

    if((a==v[2] || a==v[3]) && (b==v[2]|| b==v[3]))
        cout<<"YES\n";
    else 
        cout<<"NO\n";

    return;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    fill();
    ll t = 1;
    cin >> t;
    while (t--)
        test_case();
    return 0;
}
