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

void solve() {
    int n;
    cin >> n;
    long long arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    sort(arr, arr + n);
    if (n <= 2) {cout << "YES\n"; return;}
    if (n <= 4) {
        swap(arr[0], arr[1]);
        swap(arr[0], arr[2]);
        for (int i = 1; i < n - 1; i++) if (arr[i-1] + arr[i+1] < 2 * arr[i]) {cout << "NO\n"; return;}
        cout << "YES\n";
        return;
    }
    if (n == 5) {
        int v[5]; bool yay;
        for (int a = 0; a < 5; a++) {
            for (int b = 0; b < 5; b++) {
                if (a == b) continue;
                for (int c = 0; c < 5; c++) {
                    if (a == c || b == c) continue;
                    for (int d = 0; d < 5; d++) {
                        if (a == d || b == d || c == d) continue;
                        for (int e = 0; e < 5; e++) {
                            if (a == e || b == e || c == e || d == e) continue;
                            v[0] = arr[a];
                            v[1] = arr[b];
                            v[2] = arr[c];
                            v[3] = arr[d];
                            v[4] = arr[e];
                            yay = true;
                            for (int i = 1; i < n - 1; i++) {
                                if (v[i-1] + v[i+1] < 2 * v[i]) {
                                    yay = false;
                                    break;
                                }
                            }
                            if (yay) {cout << "YES\n"; return;}
                        }
                    }
                }
            }
        }
        cout << "NO\n";
        return;
    }
    if (n == 6) {
        int v[6]; bool yay;
        for (int a = 0; a < 6; a++) {
            for (int b = 0; b < 6; b++) {
                if (a == b) continue;
                for (int c = 0; c < 6; c++) {
                    if (a == c || b == c) continue;
                    for (int d = 0; d < 6; d++) {
                        if (a == d || b == d || c == d) continue;
                        for (int e = 0; e < 6; e++) {
                            if (a == e || b == e || c == e || d == e) continue;
                            for (int f = 0; f < 6; f++) {
                                if (a == f || b == f || c == f || d == f || e == f) continue;
                                v[0] = arr[a];
                                v[1] = arr[b];
                                v[2] = arr[c];
                                v[3] = arr[d];
                                v[4] = arr[e];
                                v[5] = arr[f];
                                yay = true;
                                for (int i = 1; i < n - 1; i++) {
                                    if (v[i-1] + v[i+1] < 2 * v[i]) {
                                        yay = false;
                                        break;
                                    }
                                }
                                if (yay) {cout << "YES\n"; return;}
                            }
                        }
                    }
                }
            }
        }
        cout << "NO\n";
        return;
    }
    if (n == 7) {
        int v[7]; bool yay;
        for (int a = 0; a < 7; a++) {
            for (int b = 0; b < 7; b++) {
                if (a == b) continue;
                for (int c = 0; c < 7; c++) {
                    if (a == c || b == c) continue;
                    for (int d = 0; d < 7; d++) {
                        if (a == d || b == d || c == d) continue;
                        for (int e = 0; e < 7; e++) {
                            if (a == e || b == e || c == e || d == e) continue;
                            for (int f = 0; f < 7; f++) {
                                if (a == f || b == f || c == f || d == f || e == f) continue;
                                for (int g = 0; g < 7; g++) {
                                    if (a == g || b == g || c == g || d == g || e == g || f == g) continue;
                                    v[0] = arr[a];
                                    v[1] = arr[b];
                                    v[2] = arr[c];
                                    v[3] = arr[d];
                                    v[4] = arr[e];
                                    v[5] = arr[f];
                                    v[6] = arr[g];
                                    yay = true;
                                    for (int i = 1; i < n - 1; i++) {
                                        if (v[i-1] + v[i+1] < 2 * v[i]) {
                                            yay = false;
                                            break;
                                        }
                                    }
                                    if (yay) {cout << "YES\n"; return;}
                                }
                            }
                        }
                    }
                }
            }
        }
        cout << "NO\n";
        return;
    }
}

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

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