#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long
#define MAX 2e9
#define MIN -1e9
#define mod 1000000007
#define pb push_back
#define case(i) cout<<"Case #"<<i<<": "
#define endl '\n'
using namespace std;
int main(){
	fast;
	ll t=1;
	cin>>t;
	while(t--){
		int arr[4];
		for(int i=0;i<4;i++){
			cin>>arr[i];
		}
		int x=max(arr[0],arr[1]);
		int y=max(arr[2],arr[3]);
		sort(arr,arr+4);
		if(x==arr[3]||x==arr[2]){
			if(y==arr[3]||y==arr[2]){
				cout<<"YES"<<endl;
				continue;
			}
		}
		cout<<"NO"<<endl;
	}
	return 0;
}