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

#define ll              long long int
#define scan(any)       for(auto &i:any) cin>>i;
#define print(any)      for(auto i:any) cout<<i<<" "; 
#define endl            '\n'
#define pb              push_back
#define vll             vector<ll> 
#define vvll            vector<vll>
#define f(i,x,y)        for(i=x;i<y;i++)
#define INF             LLONG_MAX
#define s(x)            sort(x.begin(),x.end())
struct Node
{
    int val;
    Node *next;
    Node(int x)
    {
        val=x;
        next=NULL;
    }
};

int len(Node *a)
{
    int c=0;
    while(a)
    {
        c++;
        a=a->next;
    }
    return c;
}
void push(Node *&h,int xx)
{
    Node *x=new Node(xx);
    x->next=h;
    h=x;
}
void prin(Node *a)
{
    while(a)
    {
        cout<<a->val<<" ";
        a=a->next;
    }
}
void part(Node*head,Node *&a,Node *&b)
{
    Node *c1,*c2;
    int i,j,k,l;
    l=len(head);
    k=l/2;
    if(l%2==0)
        k--;
    c1=head;
    while(k--)
    {
        c1=c1->next;
    }
    b=c1->next;
    c1->next=NULL;
    a=head;
}
Node *merge(Node *&a,Node *&b)
{
    Node *r=NULL;
    if(!a)
        return b;
    if(!b)
        return a;
    if(a->val<=b->val)
    {
        r=a;
        r->next=merge(a->next,b);
    }
    else
    {
        r=b;
        r->next=merge(a,b->next);
    }
    return r;

}
void mergeSort(Node *&head)
{
    if(!head || head->next==NULL)
        return ;
    Node *a,*b;
    part(head,a,b);
    mergeSort(a);
    mergeSort(b);

    head=merge(a,b);
}



void solve()
{
    Node *a=new Node(11);
    push(a,2);
    push(a,333);
    push(a,7);

    Node *b=new Node(12);
    push(b,62);
    push(b,4);
    push(b,3);

    Node *final=merge(a,b);
    mergeSort(final);
    prin(final);

}

struct Point
{
    ll x,y;
    Point(ll a=0,ll b=0)
    {
        x=a;
        y=b;
    }
    friend Point operator -(Point x,Point y)
    {
        return Point(x.x-y.x,x.y-y.y);
    }
    friend Point operator +(Point x,Point y)
    {
        return Point(x.x+y.x,x.y+y.y);
    }
    friend bool operator == (Point x,Point y)
    {
        return ((x.x==y.x) && (x.y==y.y));
    }
}; 
Point p0;
ll dist(Point p1, Point p2) 
{
    return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);
}

ll direction(Point p1, Point p2, Point p3) 
{ 
    ll val = (p2.y - p1.y) * (p3.x - p2.x) - 
              (p2.x - p1.x) * (p3.y - p2.y); 
    return val;
} 

bool comp(Point p1 , Point p2)
{
        ll dir = direction(p0,p1,p2);
        if(!dir)
        {
            return dist(p0,p1) < dist(p0,p2);
        }
        return dir<0;
}  
// = 0 - colinear
// > 0 - right
// < 0 - left


vector<Point> ConvexHull(vector<Point> p)
{
    ll i,j,k,n=p.size();
    ll y_mn = p[0].y;
    ll mn = 0;
    for(i=1;i<n;i++)
    {
            ll y = p[i].y;
            if(y < y_mn || (y_mn == y and p[i].x < p[mn].x))
            {
                y_mn = p[i].y;
                mn = i;
            }
    }
    swap(p[0],p[mn]);
    p0 = p[0];
    sort(p.begin(),p.end(),comp);

    ll m = 1;
    for(ll i=1;i<n;i++)
    {
            while(i+1<n and direction(p0,p[i],p[i+1]) == 0)
                    i++;
            p[m++] = p[i];
    }
    vector<Point> st;
    st.pb(p[0]);
    st.pb(p[1]);
    st.pb(p[2]);
    for(i=3;i<m;i++)
    {
        ll len=st.size();
        while(st.size()>=2 && direction(st[len - 2], st[len - 1], p[i]) >= 0)
        {
            st.pop_back();
            len--;
        }
        st.push_back(p[i]);
    }
    return st;

}
// vector<Point> p;
//ConvexHull(p)

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("E:/Programming/input.txt", "r", stdin);
        freopen("E:/Programming/output.txt", "w", stdout);
    #endif

    ios::sync_with_stdio(0);
    cin.tie(0);
    
    ll t = 1;
    cin >> t;
    while(t--)
     {
        ll i,j,k,n,a,b,c,d;
        cin>>a>>b>>c>>d;
        ll p1=max(a,b),p2=max(c,d);
        vll v={a,b,c,d};
        s(v);

        ll xy1=v[2],xy2=v[3];

        vector<ll> vv1={p1,p2};
        vector<ll> vv2={xy1,xy2};
        
        sort(vv1.begin(),vv1.end());
        sort(vv2.begin(),vv2.end());

        if(vv1[0]==vv2[0] && vv1[1]==vv2[1])
        {
            cout<<"YES\n";
        }
        else
        {

            cout<<"NO\n";
        }
        
        
    }
    return 0;
}