#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) (a).begin(), (a).end()

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

    int tc;
    cin >> tc;
    while (tc--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        vector<int> order(n);
        iota(all(order), 0);
        bool res = 0;
        do {
            bool ans = 1;
            for (int i = 1; i < n - 1; i++) {
                ans &= a[order[i - 1]] + a[order[i + 1]] >= a[order[i]] * 2;
            }
            res |= ans;
        } while (next_permutation(all(order)));
        cout << (res ? "YES\n" : "NO\n");
    }
    
}