#include<bits/stdc++.h>
using namespace std;

int main(){
    int t,k[4],a,b,c,d;
    cin >> t;
    while(t--){
        for(int i =0; i < 4; i++){
            cin >> k[i];
        }
        a = k[0];
        b = k[1];
        c = k[2];
        d = k[3];
        sort(k, k+4);
        int first = max(a,b);
        int second = max(c,d);
        if((first==k[3]) || (first==k[2]))
            if((second == k[3]) || (second == k[2]))
                cout << "YES\n";
            else
                cout << "NO\n";
        else
            cout << "NO\n";
    }
}