#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<long long, pair<long long, long long>> &a,
                  const pair<long long, pair<long long, long long>> &b) const {
    if (a.first != b.first) {
      return a.first < b.first;
    } else {
      if (a.second.first != b.second.first) {
        return a.second.first < b.second.first;
      } else {
        return a.second.second < b.second.second;
      }
    }
  }
};
template <typename T>
void show(T *a, int size) {
  int i;
  cout << endl << "The array is ";
  for (long long i = 0; i < size; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
template <typename T>
void show_vector(vector<T> v) {
  cout << endl << "The vector is ";
  int i;
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
long long TESTTEST;
long long dir[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
long long n, k;
void solve() {
  long long n;
  cin >> n;
  long long f, s;
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      cin >> f;
    } else {
      cin >> s;
    }
  }
  if (f < s) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long zzz = 1;
  cin >> zzz;
  for (TESTTEST = 1; TESTTEST < (zzz + 1); TESTTEST++) {
    solve();
  }
  return 0;
}
