#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main()
  {
  	ll T;
  	cin >> T;
  	while (T--)
  	  {
  	  	ll a,b,c,d;
  	  	cin >> a >> b >> c >> d;
  	  	vector<ll> v{a,b,c,d};
  	  	sort(v.begin(),v.end());
  	  	a = max(a,b);
  	  	c = max(c,d);
  	  	
  	  	for (ll i = 3;i >= 2;i--)
  	  	  if (v[i] == a)
  	  	    {
  	  	    	a = -1;
  	  	    	v[i] = -100;
  	  	    	break;
				}
		for (ll i = 3;i >= 2;i--)
  	  	  if (v[i] == c)
  	  	    {
  	  	    	c = -1;
  	  	    	v[i] = -100;
  	  	    	break;
				}
		if (a == -1 and c == -1)
		  cout << "YES\n";
		else 
		  cout << "NO\n";
		}
	return 0;
  }


