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

#define int long long
#define len(v) (int) (v.size())
#define all(v) v.begin(), v.end()
#define rall(v) rbegin(v), rend(v)

istream& operator>>(istream& is, vector<int>& v) {
    for (int i = 0; i < len(v); i++) {
        is >> v[i];
    }
    return is;
}

ostream& operator<<(ostream& os, vector<int>& v) {
    for (int i = 0; i < len(v); i++) {
        os << v[i] << ' ';
    }
    return os;
}

const int INF = 1e12;

struct SegmentTree {
    vector<int> tree;
    int n;
    const int NEUTRAL = -INF;

    SegmentTree(int N) {
        tree.assign(N * 4, NEUTRAL);
        n = N;
    }

    void update(int v, int l, int r, int ql, int qr, int val) {
        if (r <= ql || qr <= l) return;
        if (ql <= l && r <= qr) {
            tree[v] = max(tree[v],  val);
            return;
        }
        int m = (l + r) / 2;
        update(v * 2, l, m, ql, qr, val);
        update(v * 2 + 1, m, r, ql, qr, val);
    }
    void update(int ql, int qr, int val) {
        update(1, 0, n, ql, qr, val);
    }

    int get(int v, int l, int r, int qi) {
        if (l + 1 == r) return tree[v];
        int m = (l + r) / 2;
        if (m >= qi) return max(get(2 * v, l, m, qi), tree[v]);
        return max(get(2 * v + 1, m, r, qi), tree[v]);
    }
    int get(int qi) {
        return get(1, 0, n, qi);
    }

    int operator[] (int i) {
        return get(i);
    }
};

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    cin >> a;
    a.push_back(INF);
    a.push_back(INF);
    n++;
    sort(rall(a));
    int mn = a.back();
    // a.pop_back();

    vector<int> r(n);
    r[n - 1] = r[n - 2] = n - 1;
    for (int i = n - 3; i >= 0; i--) {
        if (a[i] - a[i + 1] >= a[i + 1] - a[i + 2]) {
            r[i] = r[i + 1];
        }
        else {
            r[i] = i + 1;
        }
    }

    SegmentTree dp1(n);
    vector<int> dp2(n, -INF);
    // base
    dp2[3] = INF;
    for (int i = 4; i <= r[2] + 1; i++) {
        if (i == n) {
            if (a[n - 2] - a[n - 1] >= a[n - 1] - mn) {
                cout << "YES\n";
                return;
            }
        }
        else {
            dp1.update(i, i + 1, INF);
        }
    }

    vector a_r = a;
    reverse(all(a_r));

    // calc
    for (int i = 3; i + 1 < n; i++) {
        if (a[i - 2] - a[i - 1] >= a[i - 1] - a[i + 1]) {
            dp2[i + 1] = max(dp2[i + 1], dp1[i]);
        }
        if (dp2[i] - a[i - 1] >= a[i - 1] - a[i + 1]) {
            dp2[i + 1] = max(dp2[i + 1], a[i - 2]);
        }

        if (dp1[i] - a[i] >= a[i] - a[i + 1]) {
            int x = r[i] + 1;
            if (a[i - 2] - a[i - 1] < a[i - 1] - a[x]) {
                x = lower_bound(all(a_r), 2 * a[i - 1] - a[i - 2]) - a_r.begin();
                x = n - x;
            }
            if (x == n) {
                if (a[n - 2] - a[n - 1] >= a[n - 1] - mn && a[i - 2] - a[i - 1] >= a[i - 1] - mn) {
                    cout << "YES\n";
                    return;
                }
                x--;
            }
            dp1.update(i + 1, x + 1, a[i - 1]);
        }
        if (a[i - 2] - a[i] >= a[i] - a[i + 1]) {
            int x = r[i] + 1;
            if (dp2[i] - a[i - 1] < a[i - 1] - a[x]) {
                x = lower_bound(all(a_r), 2 * a[i - 1] - dp2[i]) - a_r.begin();
                x = n - x;
            }
            if (x == n) {
                if (a[n - 2] - a[n - 1] >= a[n - 1] - mn && dp2[i] - a[i - 1] >= a[i - 1] - mn) {
                    cout << "YES\n";
                    return;
                }
                x--;
            }
            dp1.update(i + 1, x + 1, a[i - 1]);
        }
    }


    if ((a[n - 3] - a[n - 2] >= a[n - 2] - mn && dp1[n - 1] - a[n - 1] >= a[n - 1] - mn) ||
        (dp2[n - 1] - a[n - 2] >= a[n - 2] - mn && a[n - 3] - a[n - 1] >= a[n - 1] - mn)) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
}