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

void solve() {
    int n;
    cin >> n;
    long long a[n], v[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    if (n >= 3) swap(a[2], a[1]);
    for (int i = 1; i < n - 1; i++) if (a[i-1] + a[i+1] < 2 * a[i]) {cout << "NO\n"; return;}
    
    cout << "YES\n";
    return;
}

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

    int t;
    cin >> t;
    while (t--) solve();
}
