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

typedef long long ll;

ll n;

void go()
{
    cin>>n;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++) cin>>a[i];
    sort(a.begin(), a.end());
    do
    {
        bool y = 1;
        for(ll i = 1; i< n - 1; i++)
        {
            if(a[i] * 2 > a[i - 1] + a[i + 1])
            {
                y = 0;
                break;
            }
        }

        if(y) 
        {
            cout<<"YES\n";
            return;
        }
    }while(next_permutation(a.begin(), a.end()));

    cout<<"NO\n";
    return;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int test_cnt = 1;
    cin>>test_cnt;
    while(test_cnt--) go();
}
