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

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll a[n];
        vector<ll>per(n);
        for(ll i=0;i<n;i++){
            cin>>a[i];
            per[i]=i;
        }
        ll cl=0, hi=0;
        do{//cl++;
            //cout<<cl<<endl;
            ll h=1;
            for(ll i=1;i<n-1;i++){
                if(2*a[per[i]]<=a[per[i-1]]+a[per[i+1]]){}
                else {h=0;break;}
            }
            if(h==1){
                cout<<"YES"<<endl;hi=1;break;
            }
        }while(next_permutation(per.begin(), per.end()));
        if(!hi)cout<<"NO"<<endl;
    }
}
