#include <bits/stdc++.h>
#include <random>

using namespace std;

#define ll long long
#define endl '\n'
#define ld long double
#define pb push_back

const ll clasik = 7e5+7;
const ll INF = 1e17;
const ll mod = 1e9+7;
const ll mln = 1e6+111;

mt19937 vira(1488);

bool used[clasik];
ll n;
ll a[clasik];

bool ok;

void check() {
    for (int i = 2 ; i<n ; i++) {
        if (a[i]*2 > a[i-1] + a[i+1]) return;
    }
    ok = 1;
}

void put(int pos , int p) {
    a[pos] = df[p];
    if (pos==n) {
        check();
        return;
    }

    for (int i = 1 ; i<=n ; i++) {
        if (used[i]) continue;
        used[i] = 1;
        put(pos+1 , i);
        used[i] = 0;
    }

}


void solve() {
    cin>>n;

    if (n<=4) {
        for (int i = 1 ; i<=n ; i++) {
            cin>>df[i];
            used[i] = 0;
        }
    for (int i = 1 ; i<=n ; i++) {
        used[i] = 1;
        put(1 , i);
        used[i] = 0;
    }

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

    vector <ll> v(n);

    for (int i = 0 ;i<n ; i++) {
        cin>>v[i];
    }

    for (int i = 1 ; i<=10000; i++) {
        shuffle(v.begin() , v.end() , vira);
        bool ok = 0;
        //for (int j = 0 ; j<n ; j++) cout<<v[j]<<endl;
        for (int j = 1 ; j < n-1 ; j++) {
            if (v[j]*2 > v[j-1] + v[j+1]) {
                ok = 1;
                break;
            }
        }
        if (ok) continue;
        cout<<"YES"<<endl;
        return;
    }

    cout<<"NO"<<endl;

}

signed main() {
    
    int t = 1;

    cin>>t;

    while(t--) solve();

    return 0;
}