#include <iostream>
#include <math.h>
#include <vector>
#include <string>
#include <algorithm>
#define ll long long
#define li long int
#define ld long double

using namespace std;

int main() {
  ll t;
  cin >> t;
  while (t--) {
     int s[4];
     for(int i=0;i<4;i++){
        cin>>s[i];
  }
  int l=max(s[0],s[1]);
  int r=max(s[2],s[3]);
  sort(s,s+4,greater<int>());
  if(l>r){
        if(s[0]==l && s[1]==r)
    cout<<"YES"<<endl;
    else
         cout<<"NO"<<endl;
  }
  else{
        if(s[0]== r && s[1]==l)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
  }
  }
  return 0;
}
