#include <bits/stdc++.h>
#define lli long long int
#define pii pair<lli,lli>
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define forrr(j,a,n) for(lli j=a;j<n;j++)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ff first
#define ss second
#define pi2  1.57079632679489661923

using namespace std;


void print(lli a[],lli n){
forr(0,n){cout<<a[i]<<" ";}
cout<<"\n";
}
lli power1(lli x){
lli u=0;
while(x>0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    if(m==1){return 0;}
    lli ans=1,r=1;
    x%=m;
    if(y==0){return 1;}
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
lli powm(lli a, lli b) {
	lli res = 1;
	while (b) {
		if (b & 1)
			res = (res * a);
		a = (a * a);
		b >>= 1;
	}
	return res;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

lli gcdExtended(lli a, lli b, lli *x, lli *y){
if(a==0){
    *x=0;
    *y=1;
    return b;
}
lli x1,y1;
lli d=gcdExtended(b%a,a,&x1,&y1);
*x=y1-(b/a)*x1;
*y=x1;
return d;
}
//If b | a, then we can write (a/b) % p as (a % p*b)/b
lli modI(lli a, lli m)
{
    lli m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        lli q=a/m;
        lli t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n % 2 == 0 || n % 3 == 0)
        return false;

    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;

    return true;
}
/*
vector <lli> adj[100001];
lli vis[100001];
lli b[100001][2];
lli dp[100001][2];
void dfs(lli a){
    vis[a]=1;
    dp[a][0]=0;
    dp[a][1]=0;
    forr(0,adj[a].size()){
    if(vis[adj[a][i]]){continue;}
    else{
        dfs(adj[a][i]);
        dp[a][0]+=max(abs(b[adj[a][i]][0]-b[a][0])+dp[adj[a][i]][0],abs(b[a][0]-b[adj[a][i]][1])+dp[adj[a][i]][1]);
         dp[a][1]+=max(abs(b[adj[a][i]][0]-b[a][1])+dp[adj[a][i]][0],abs(b[a][1]-b[adj[a][i]][1])+dp[adj[a][i]][1]);
    }
    }
}
*/
/*
lli level[200001];
void bfs(lli a){
queue <lli> q;
vis[a]=1;
level[a]=0;
q.push(a);
while(!q.empty()){
    lli p=q.front();
    q.pop();
    forr(0,adj[p].size()){
    if(vis[adj[p][i]]==0){
        level[adj[p][i]]=level[p]+1;
        q.push(adj[p][i]);
        vis[adj[p][i]]=1;
    }
    }

}
}
*/
/*
vector <pair<lli,lli> > dj[200001];
lli dist[200001];
void dijkstra(lli a){
dist[a]=0;
multiset<pair<lli,lli> > s;
s.insert({0,a});
while(s.size()!=0){
    lli x=(*s.begin()).second;
    s.erase(s.begin());
    if(vis[x]){continue;}
    vis[x]=1;
    forr(0,dj[x].size()){
    lli e=dj[x][i].first;
    lli we=dj[x][i].second;
    if(dist[x]+we<dist[e]){
        dist[e]=dist[x]+we;
        s.insert({dist[e],e});
    }
    }
}

}
*/
/*
lli s[10000001];
void sieveOfEratosthenes(lli N)
{
    // Create a boolean array "prime[0..n]" and
    // initialize all entries in it as false.
    //https://www.geeksforgeeks.org/print-all-prime-factors-and-their-powers/?ref=rp
    vector <bool> prime(N+1, false);

    // Initializing smallest factor equal to 2
    // for all the even numbers
    for (lli i=2; i<=N; i+=2)
        s[i] = 2;

    // For odd numbers less then equal to n
    for (lli i=3; i<=N; i+=2)
    {
        if (prime[i] == false)
        {
            // s(i) for a prime is the number itself
            s[i] = i;

            // For all multiples of current prime number
            for (lli j=i; j*i<=N; j+=2)
            {
                if (prime[i*j] == false)
                {
                    prime[i*j] = true;

                    // i is the smallest prime factor for
                    // number "i*j".
                    s[i*j] = i;
                }
            }
        }
    }
}
vector<lli> v;

void generatePrimeFactors(lli N)
{
    // s[i] is going to store smallest prime factor
    // of i.

    // Filling values in s[] using sieve

    lli curr = s[N];  // Current prime factor of N
    lli cnt = 1;   // Power of current prime factor

    // Printing prime factors and their powers
    while (N > 1)
    {
        N /= s[N];

        // N is now N/s[N].  If new N als has smallest
        // prime factor as curr, increment power
        if (curr == s[N])
        {
            cnt++;
            continue;
        }
        // Update current prime factor as s[N] and
        // initializing count as 1.
        v.pb(cnt);
        curr = s[N];
        cnt = 1;
    }
}
*/
/*
struct segtree{// REMEMBER THAT r AND rx ARE EXCLUDED INDICES IN THIS IMPLEMENTATION
lli size1;
vector<lli> store_sum;//stores the sum of elements which are completely inside lx(inclusive) and rx(exclusive) inside the node of the segment tree
vector<lli> lazy;
// Please see the lines with "??????" while using lazy propagation
lli id=0;
    lli f(lli x,lli y)
    {
        return x+y;
    }
    void init(lli n)
    {
        size1=1;
        while(size1<n){size1*=2;}
        store_sum.assign(2*size1,id);
        lazy.assign(2*size1,0LL);
    }

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    void build(vector<lli>&a,lli x,lli lx,lli rx)//x is the index of the node of the segment tree which we are processing right now
    {
        if(rx-lx==1){
            if(lx<(lli)a.size()){
                store_sum[x]=a[lx];
            }
            return ;
        }
        lli mid=(lx+rx)/2;
        build(a,2*x+1,lx,mid);
        build(a,2*x+2,mid,rx);
        store_sum[x]=f(store_sum[2*x+1],store_sum[2*x+2]);
    }
    void build(vector<lli>&a)
    {
        build(a,0,0,size1);
    }
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

     void update_node(lli i,lli v,lli x,lli lx,lli rx)
    {
        if(rx-lx==1){
            store_sum[x]=v;
            return ;
        }
        lli mid=(lx+rx)/2;
        if(i<mid){
            update_node(i,v,2*x+1,lx,mid);
        }
        else{
            update_node(i,v,2*x+2,mid,rx);
        }
        store_sum[x]=f(store_sum[2*x+1],store_sum[2*x+2]);
    }
    void update_node(lli i,lli v)
    {
        update_node(i,v,0LL,0LL,size1);
    }
    lli query_node(lli l,lli r,lli x,lli lx,lli rx)
    {
        if(lx>=r || rx<=l){
            return id;//return the identity element(b,in this case 0) so that a@b=a
        }
        if(lx>=l && rx<=r){return store_sum[x];}
        else{

            lli mid=(lx+rx)/2;
            lli s1= query_node(l,r,2*x+1,lx,mid);
            lli s2=query_node(l,r,2*x+2,mid,rx);
            return f(s1,s2);

        }
    }
    lli query_node(lli l,lli r)
    {
        return query_node(l,r,0,0, size1);
    }

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    void update_range(lli l, lli r, lli v, lli x, lli lx, lli rx)
    {
        if(lazy[x]!=0){
            store_sum[x]+=((rx-lx)*lazy[x]);// ?????????????????????????????????????????????????????
            if(lx!=rx-1){
                lazy[2*x+1]+=lazy[x];
                lazy[2*x+2]+=lazy[x];
            }
            lazy[x]=0;
        }
        if(lx>=rx || lx>=r || rx<=l){
            return;
        }
        if(lx>=l && rx<=r){
            store_sum[x]+=((rx-lx)*v);// ?????????????????????????????????????????????????????????????
            if(lx!=rx-1){
                lazy[2*x+1]+=v;
                lazy[2*x+2]+=v;
            }
            return ;
        }
        lli mid=(lx+rx)/2;
        update_range(l,r,v,2*x+1,lx,mid);
        update_range(l,r,v,2*x+2,mid,rx);
        store_sum[x]=f(store_sum[2*x+1],store_sum[2*x+2]);
    }
    void update_range(lli l,lli r,lli v)
    {
        update_range(l,r,v,0LL,0LL,size1);
    }

     lli query_range(lli l,lli r,lli x,lli lx,lli rx)
    {
        if(lx>=rx || lx>=r || rx<=l){
            return id;
        }
        if(lazy[x]!=0){
            store_sum[x]+=(rx-lx)*lazy[x];// ??????????????????????????????????????????????????????
            if(lx!=rx-1){
                lazy[2*x+1]+=lazy[x];
                lazy[2*x+2]+=lazy[x];
            }
            lazy[x]=0;
        }
        if(lx>=l && rx<=r){return store_sum[x];}
        else{

            lli mid=(lx+rx)/2;
            lli s1= query_range(l,r,2*x+1,lx,mid);
            lli s2=query_range(l,r,2*x+2,mid,rx);
            return f(s1,s2);

        }
    }
    lli query_range(lli l,lli r)
    {
        return query_range(l,r,0,0, size1);
    }

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
};
*/
/*
vector<lli> par,size_of_set;
void make_set(lli v)
{
    par[v]=v;
    size_of_set[v]=1;
}
lli find_set(lli v)
{
    if(v==par[v]){return v;}
    return par[v]=find_set(par[v]);
}

void union_sets(lli a, lli b)
{
    a=find_set(a);
    b=find_set(b);
    if(a!=b){
        if(size_of_set[a]<size_of_set[b]){swap(a,b);}
        par[b]=a;
        size_of_set[a]+=size_of_set[b];
    }
}
*/

int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
   //freopen("in.txt","r",stdin);
   //freopen("out.txt","w",stdout);
int t2=1;
cin>>t2;
lli M =1e9+7;
while(t2--){
lli a[4];
lli b[4];
forr(0,4){cin>>a[i];b[i]=a[i];}
sort(b,b+4);
lli l=1;
if(a[0]>a[1] && b[3]==a[0] && b[2]==a[1]){l=0;}
if(a[0]<a[1] && b[2]==a[0] && b[3]==a[1]){l=0;}
if(a[2]>a[3] && b[3]==a[2] && b[2]==a[3]){l=0;}
if(a[3]>a[2] && b[3]==a[3] && b[2]==a[2]){l=0;}
if(l){cout<<"YES\n";}
else{cout<<"NO\n";}
}
     return 0;
}
