#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;



struct DSU {
    int n;
    vector<int> p, h;

    DSU(int m) {
        n = m;
        p.assign(n + 1, -1);
        h.assign(n + 1, 1);

        for (int i = 0; i <= n; i++) {
            p[i] = i;
            h[i] = 1;
        }
    }

    int findParent(int node) {
        if (p[node] == node) {
            return node;
        }
        return p[node] = findParent(p[node]);
    }

    bool sameSet(int a, int b) {
        a = findParent(a);
        b = findParent(b);
        return a == b;
    }

    void unionSets(int a, int b) {
        a = findParent(a);
        b = findParent(b);
        if (a == b) return;
        if (h[a] < h[b]) {
            swap(a, b);
        }
        p[b] = a;
        h[a] += h[b];
    }
};

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

    int T;
    cin >> T;
    while (T--) {
        int n;
        cin >> n;

        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        sort(a.begin(), a.end());

        int bad = -1;
        for (int i = 1; i < n - 1; i++) {
            if (2 * a[i] > a[i - 1] + a[i + 1]) {
                bad = i + 1;
                break;
            }
        }
        if (bad == -1) {
            printf("YES\n");
        }
        else {
            a.erase(a.begin() + bad);
            n--;
            bool ok = true;
            for (int i = 1; i < n - 1; i++) {
                if (2 * a[i] > a[i - 1] + a[i + 1]) {
                    ok = false;
                    break;
                }
            }

            printf(ok ? "YES\n" : "NO\n");
        }
        
    }



    


    
    
}