#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);

void solve() {

    ll n;

    cin>>n;

    vector <ll> v(n);

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

    for (int i = 1 ; i<=40; 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 ; 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;
}