#include <bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define fst first
#define snd second
#define ff first
#define st second
#define endl "\n"

void I_LOVE_PEREKOPSKA() {
    int n;
    cin>>n;
    vector<int> a(n);
    for (auto &x:a)
        cin>>x;
    sort(all(a));
    int f = 0;
    auto check = [&](vector<int> b) {
        bool f = 1;
        for (int i=1;i<n-1;i++)
            f &= (b[i]<=(b[i-1]+b[i+1])/2);
        return f;
    };
    do {
        if (check(a)) {
            cout<<"YES"<<endl;
            return;
        }
    } while (next_permutation(all(a)));
    cout<<"NO"<<endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int t = 1;
    cin>>t;
    while (t--) {
        I_LOVE_PEREKOPSKA();
    }
}