text: /*
  	author: Susmoy Sen Gupta
  	email: susmoy.cse@gmail.com
  	github: github.com/SusmoySenGupta
  
  	Judge: Codeforces
  	problem no: 1535A
  	problem name: Fair Playoff
  	problem link: https://codeforces.com/problemset/problem/1535/A
  
  	Status: __Solved__
  	Solved at: Jul/28/2021 22:12
  */
  
  #include <iostream>
  
  #define INF (int)1e9
  #define EPS 1e-9
  #define MOD 1000000007ll
  #define PI 3.14159
  
  #define lli long long int
  
  #define rep(i, a, n) for (int i=a; i<n; i++)
  #define per(i, a, n) for (int i=n-1; i>=a; i--)
  
  using namespace std;
  
  void solve()
  {
      int arr[5];
  
      rep(i, 0, 4) scanf("%d", &arr[i]);
  
      int min_a = min(arr[0], arr[1]), max_a = max(arr[0], arr[1]);
      int min_b = min(arr[2], arr[3]), max_b = max(arr[2], arr[3]);
  
      min(max_a, max_b) > max(min_a, min_b) ? printf("YES\n") : printf("NO\n");
  }
  
  int main()
  {
      int t;
  
      scanf("%d", &t);
  
      while(t--) solve();
  
      return 0;
  }
  