#include <bits/stdc++.h>
#define endl '\n'
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define deb(x) cout << #x << ':' << x << '\n';

using namespace std;
template<class T>void show(vector<T> &a) {cerr << "[ "; for (int ij = 0; ij < (int)a.size(); ij++) {cerr << a[ij] << " ";} cerr << "]\n";}
template<class T>void show(T a) {cerr << a << endl;}
template<typename... T>void show(T... args) {((cerr << args << ' '), ...); cerr << endl;}
template<class T>void read(vector<T> &a) {for (auto &x : a) {cin >> x;}}
template<class T> void read(T &a) {cin >> a;}


void solve() {
	int a[4];
	for (int i = 0; i < 4; i++) {
		cin >> a[i];
	}
	int s1, s2, s3, s4;
	s1 = a[0];
	s2 = a[1];
	s3 = a[2];
	s4 = a[3];
	bool flag = true;
	sort(a, a + 4);
	int x = a[3];
	int y = a[2];
	// cout << x << y;
	if ((s1 == x && s2 == y) || (s1 == y && s2 == x)) flag = false;
	if ((s3 == x && s4 == y) || (s3 == y && s4 == x)) flag = false;
	if (flag == true) cout << "YES" << endl;
	else cout << "NO" << endl;

}


int32_t main(int32_t argc, char *argv[]) {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int T ;
	cin >> T;
	while (T--) {
		solve();
	}
	cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
}