#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
#define pii std::pair<int, int>
void solve() {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> a[i];
    }
    std::sort(a.begin(), a.end());
    bool ans = true;
    for (int i = 1; i < n - 1; ++i) {
        if (2 * a[i] > a[i-1] + a[i]) {
            ans = false;
            break;
        }
    }
    std::cout << (ans ? "YES" : "NO") << "\n";
}
int main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t;
    std::cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}