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

typedef long long ll;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL);

ll m = 1000000007;

ll powl(ll a,ll b)
{
    ll ans = 1;
    while(b!=0)
    {
        if(b&1)
            ans = (ans*a)%m;
        a = (a*a)%m;
        b = b/2;
    }
    return ans;
}

ll ceill(ll a, ll b)
{

    if(a%b==0)
    {
        return (a/b);
    }
    ll k = (a/b)+1;
    return k;
}



int main()
{
    boost
    int t;
    cin >> t;
    while(t--)
    {
      ll a,b,c,d;
      cin >> a >> b >> c  >> d;
      ll p[4] = {a,b,c,d};
      sort(p,p+4);
      int f = 0;
      if(p[0]==a || p[0]==b)
      {
          if(p[1]==c|| p[1]==d)
            f=1;
      }
      else if(p[1]==a || p[1]==b)
      {
          if(p[0]==c|| p[0]==d)
            f=1;
      }
      if(f)
        cout << "YES\n";
      else
        cout << "NO\n";

    }


}
