#include <bits/stdc++.h>
typedef long long lint;
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lint t;
    cin>>t;
    while(t--)
    {
        vector<lint> arr(4,0);
        cin>>arr[0]>>arr[1]>>arr[2]>>arr[3];
        lint a=max(arr[0],arr[1]),b=max(arr[2],arr[3]);
        sort(arr.begin(),arr.end());
        if(max(a,b)==arr[3]&&min(a,b)==arr[2])
        cout<<"YES\n"; else cout<<"NO\n";
    }
    return 0;
}
