#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
typedef vector<int>vi;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fi first
#define se second
#define de(x) cout<<#x<<"="<<x<<"\n"
#define dd(x) cout<<#x<<"="<<x<<" "
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define lowbit(a) ((a)&-(a))
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define mp make_pair
#define sec ((clock_t)1000)
const int N = 5e5 + 5;
const int inf = 0x3f3f3f3f;
int n , b[N],a[N];
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		rep(i , 1 , 4 + 1)
			scanf("%d",&a[i]);
		int x = max(a[1],a[2]);
		int y = max(a[3],a[4]);
		sort(a + 1,a + 5);
		if(min(x,y) == a[3] && max(x,y) == a[4])
			printf("YES\n");
		else printf("NO\n"); 
	}
	
	return 0;
}
