#include <bits/stdc++.h>

#pragma optimize("Ofast,unroll-loops,O3")
#pragma target("avx,avx2,tune=ative")

using namespace std;

#define ll long long
#define pb push_back
#define all(x) (x).begin(), (x).end()
using pii = pair<int, int>;

bool check(vector<int> v) {
    int n = v.size();
    for(int i = 1; i < n - 1; i++) {
        if(v[i - 1] + v[i + 1] < 2 * v[i]) {
            return true;
        }
    }
    return false;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t, n, f;
    cin >> t;

    while(t--) {
        cin >> n;

        vector<int> v(n), x;

        for(int &i: v) {
            cin >> i;
        }

        sort(v.begin(), v.end());
        for(int i = 0; i < n - 1; i += 4) {
            swap(v[i], v[n - i - 1]);
        }
        x = v;
        f = 1;

        while(check(x)) {
            next_permutation(x.begin(), x.end());

            if(x == v) {
                cout << "NO\n";
                f = 0;
                break;
            }
        }

        if(f)
            cout << "YES\n";
    }
}
