#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,j,k) for(ll i=j;i<k;i++)
#define rrep(i,j,k) for(ll i=j;i>=k;i--)
#define rit(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define endl "\n"
#define ps(x,y) fixed<<setprecision(y)<<x
#define pi 3.1415926535897932384626
#define mod 1000000007
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
 
//Modular Exponentiation
ll mpow(ll base,ll exp) {
   base %= mod;
   ll result = 1;
   while (exp > 0) {
   if (exp & 1) result = (result * base) % mod;
   base = (base * base) % mod;
   exp >>= 1;
   }
   return result;
}
 
 
//Write Here
void solve() {
    ll a1,a2,a3,a4;
    cin>>a1>>a2>>a3>>a4;
    ll p=max(a1,a2);
    ll q=max(a3,a4);
    ll b[4];
    b[0]=a1;
    b[1]=a2;
    b[2]=a3;
    b[3]=a4;
    sort(b,b+4);
    if((b[3]==p && b[2]==q)|| (b[3]==q && b[2]==p))
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
}
 
int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int t=1;
    cin>>t;
    while(t--) {
        solve();
    }
    return 0;
}