#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define f first
#define s second
 
void solve()
{
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if(min(a,b) > max(c, d) || min(c, d)>max(a,b))
    {
        cout<<"NO"<<endl;
    }else{
        cout<<"YES"<<endl;
    }
}
 
int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    #endif
    ll t;cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
