//#pragma GCC optimize("inline,Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,avx,abm")
#include <bits/stdc++.h>
#define ll long long
#define int ll
typedef double ld;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define y0 dfgoert
using namespace std;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = 1000000007;

void solve() {
    int s1, s2, s3, s4;
    cin >> s1 >> s2 >> s3 >> s4;
    int f = max(s1, s2);
    int s = max(s3, s4);
    if (f > min(s3, s4) && s > min(s1, s2))cout << "YES\n";
    else cout << "NO\n";
}

int32_t main() {
    fast
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
}

/**
*/
