#include <bits/stdc++.h>

using namespace std;

/*
if(used[to]) low[v]=min(low[v],tin[to])
else{
    dfs(to,v);
    low[v]=min(low[v],low[to]);

    if(low[to]>tin[v]) rebro;
}*/
#define ll long long
const ll F=1e18,N=2e6;
ll n,a[N];

multiset<ll> el;

bool per(){
for(ll i=2;i<n;++i) if(a[i]*2>a[i-1]+a[i+1]) return 0;
return 1;
}

ll fc(ll n){
    ll z=1;
    for(ll i=2;i<=n;++i) z*=i;
    return z;
}


string solve(){

    cin>>n;
    
    for(ll i=1;i<=n;++i) cin>>a[i];

    ll k=fc(n);

    while(k--){
        if(per()) return "YES\n";

        next_permutation(a+1,a+1+n);
    }


    return "NO\n";
}

int main()
{
    ll q=1;


    cin>>q;
    while(q--) cout<<solve();
}
