#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define gcd __gcd
#define INF (ll)1e15

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
// 	long t=1;
	ll t;
	cin>>t;
	while(t--)
		{
		   ll a,b,c,d;
		   cin>>a>>b>>c>>d;
		   vector<ll>v;
		   v.push_back(a);
		   v.push_back(b);
		   v.push_back(c);
		   v.push_back(d);
		   ll ma = max(a,b);
		   ll mb= max(c,d);
		   sort(v.rbegin(),v.rend());
		   if((v[0]==ma&&v[1]==mb)||(v[0]==mb&&v[1]==ma))
		   cout<<"YES"<<endl;
		   else
		   cout<<"NO"<<endl;
		   
		   
		}
		return 0;
}
 