#include <bits/stdc++.h>

using namespace std;
#define ll long long;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t; cin >> t;
    int u;
    while(t--)
    {
        int n; cin >> n;
        u=0;
        int a[n+1];
        for(int i=1; i<=n; i++) cin >> a[i];
        sort(a+1,a+n+1);
        for(int i=3; i<=n; i++) {if(a[i]==a[i-2] && u==0) {cout << "NO" << endl;u=1;}}
        if(u==1) continue;

        deque <int> q;
        q.push_front(a[1]);
        q.push_front(a[2]);
        int qf=a[1], qb=a[2];
        for(int i=3; i<=n; i++)
        {
            if(q.front()*2>qf+a[i] && q.back()*2>qb+a[i]){u=1; i=n+1;}
                else if(q.front()==a[i]){qb=q.back(); q.push_back(a[i]);}
                    else if(q.front()*2>qf+a[i]){qb=q.back(); q.push_back(a[i]);}
                        else if(q.back()*2>qb+a[i]){qf=q.front(); q.push_front(a[i]);}
                            else if(q.front()>q.back()){qf=q.front(); q.push_front(a[i]);}
                                else {qb=q.back(); q.push_back(a[i]);}
        }
        if(u==1) {cout << "NO" << endl; continue;}
        cout << "YES" << endl;
    }
}
