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

const int DIM = 3e5;
int arr[DIM], len;

void input(){
    cin >> len;
    for (int i = 0; i < len; ++i)
        cin >> arr[i];
}

bool is_true(){
    for (int i = 1; i < len-1; ++i)
        if (arr[i] * 2 > arr[i-1] + arr[i+1])
            return false;
    return true;
}

bool shuffle_ex(){
    sort(arr, arr + len);

    int temp = arr[len-2];
    for (int i = len-2; i > 0; --i)
        arr[i] = arr[i-1];
    arr[0] = temp;

    return is_true();
}

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

    int q_test; cin >> q_test;
    for (int i = 0; i < q_test; ++i){
        input();
        cout << (shuffle_ex() ? "YES\n" : "NO\n");
    }
}
