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

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

    int t;
    cin>>t;
    for(int i = 0;i < t;i++){
        int n;
        cin >> n;
        vector<int> a_(n);
        for(int i = 0;i < n;i++){
            cin >> a_[i];
        }
        sort(a_.begin(), a_.end());
        vector<int> a(n);
        for(int i = 0;i < (n + 1) / 2;i++){
            a[i] = a_[n - 1 - i * 2];
            if(n % 2 == 0)
            a[n - i - 1] = a_[n - 1 - i * 2 -1];
        }
        //for(auto x : a)cout << x << " ";cout << endl;
        bool isValid = true;
        for(int i = 1;i < n - 1;i++){
            if(2 * a[i] > a[i - 1] + a[i + 1]){
                isValid = false;
            }
        }
        
        cout << (isValid ? "YES" : "NO") << endl;
    }
}
