#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
 
  int main() {
	#ifdef LOCALFLAG 
		freopen("input5.txt", "r", stdin);
		freopen("output5.txt", "w", stdout);
	#endif

ll t;
cin >>t;

for(ll i=0;i<t;i++){
   int x,y,z,w;
   cin >> x >> y >> z >> w;
   
   if(x>max(z,w) && y>max(z,w)){
       cout << "NO" << endl;
   }else if(z>max(x,y) && w>max(x,y)){
       cout << "NO" << endl;
   }else{
       cout << "YES" << endl;
   }
   
  
}

 
     return 0;
     
     }