#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	while(t--)
	{
		
		int arr[4];
		for(i=0;i<4;i++)
		{
			cin>>arr[i];
		}
		for(i=0;i<1;i++)
		{
           if(max(arr[i],arr[i+1])<min(arr[i+2],arr[i+3]))
		   {
		     cout<<"NO"<<endl;  	
		  }	
		  else if(min(arr[i],arr[i+1])>max(arr[i+2],arr[i+3]))
		   {
		     cout<<"NO"<<endl;  	
		  }		
		  else
		  {
		  	cout<<"YES"<<endl;
		  }
			
			
			
		}
		
		
		
		
		
	}
	return 0;
	
	
	
}