#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(n) for(int i = 0; i< n; i++)
#define sf(a) scanf("%d", &a)
#define sfll(a) scanf("%lld", &a)
#define sfd(a) scanf("%lf", &a)
#define sf2i(a, b) scanf("%d %d", &a, &b)
#define sf4i(a,b,c,d) scanf("%d %d %d %d", &a, &b, &c, &d)
#define pfd(a) printf("%lf\n", a)
#define pf(a) printf("%d\n", a)
#define pfll(a) printf("%lld\n", a)
int n;
int maxOne = 0;
int maxTwo = 0;
int pointOne;
int pointTwo;
bool jd = true;
int a[3];
int b[3];
int compare[4];
int main(){
    sf(n);
    f(n){
        jd = true;
        maxOne = 0;
        maxTwo = 0;
        for (int j = 0; j<2; j++){
            sf(a[j]);
            if (maxOne < a[j]){
                maxOne = a[j];
            }else{
                pointOne = j;
            }
        }
        for (int g = 0; g<2; g++){
            sf(b[g]);
            if (maxTwo < b[g]){
                maxTwo = b[g];
            }else{
                pointTwo = g;
            }
        }   
        
        for (int d = 0; d<2; d++){
            compare[d] = a[d];
        }
        compare[2] = b[0];
        compare[3] = b[1];

        sort(compare, compare+ 4);

        if (maxOne > maxTwo){
            if (compare[3] > maxOne){
                jd = false;
                printf("NO\n");
            }
            if (compare[2] > maxTwo){
                jd = false;
                printf("NO\n");
            }
        }else{
            if (compare[3] > maxTwo){
                jd = false;
                printf("NO\n");
            }
            if (compare[2] > maxOne){
                jd = false;
                printf("NO\n");
            }
        }

        if (jd){
            printf("YES\n");
        }
        
    }
}