#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll long long
#define vll vector<ll>
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
#define fr first
#define se second
#define pb push_back
#define vvll vector<vll>
#define pll pair<ll, ll>
#define vbool vector<bool>
#define INF 10000000000000000

using namespace std;
using namespace __gnu_pbds;

bool f(vll& a) {
    for (int i = 1; i < a.size()-1; i ++) {
        if (a[i-1]+a[i+1] < 2*a[i]) return 0;
    }
    return 1;
}

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

    ll t;
    cin >> t;

    while (t --) {
        ll n;
        cin >> n;
        vll a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        sort(a.begin(), a.end());

        if (f(a)) {
            cout << "YES" << endl;
            continue;
        }
        bool q = 0;
        while (next_permutation(a.begin(), a.end())) {
            if (f(a)) {
                /*for (int i : a) {
                    cout << i << ' ';
                }*/
                cout << endl;
                q = 1;
                break;
            }
        }

        if (q)cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}