    #include<bits/stdc++.h>
    using namespace std;
    #define endl "\n"
    #define mp make_pair
    #define ll long long
    #define mod 1000000007

int main(){

    ios_base::sync_with_stdio(false);cin.tie(NULL);
   /* // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    */
  
    int t;
    cin>>t;
    while(t--){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int maxi1=max(a,b);
        int maxi2=max(c,d);
        vector<int> v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
        sort(v.begin(),v.end(),greater<int>());
        if((maxi1==v[0] || maxi1==v[1]) and (maxi2==v[0] || maxi2==v[1]))
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}