/*IN FISH AT EGOI I TRUST*/
/*IN FISH AT EGOI I TRUST*/
/*IN FISH AT EGOI I TRUST*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppl;
typedef long double ld;

mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
/*#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt")*/

ll tt,n,a[1000009];
bool can(ll pos,deque<ll> &A){
     ll x=a[pos];
     if((A[pos-2]*2-A[pos-3])>a[n] && (A[0]*2-A[1])>a[n]) return false;
    bool g=((A[pos-2]*2-A[pos-3])<=x);
    bool t=((A[0]*2-A[1])<=x);
   /* cout<<"P "<<pos<<endl;
    for(auto x:A) cout<<x<<" ";
    cout<<endl;
    cout<<"G "<<g<<" "<<t<<endl;*/
   if(g && (!t || pos==n)) {
      A.push_back(x);
      if(pos==n) return true;
      if(can(pos+1,A)) return true;
      A.pop_back();
      return false;
   }
   if(!g && t) {
      A.push_front(x);
      if(pos==n) return true;
      if(can(pos+1,A)) return true;
      A.pop_front();
      return false;
   }
   if(!g && !t) return false;


   ll P=gen();
   if(P%100!=1) {
      A.push_back(x);
      if(pos==n) return true;
      if(can(pos+1,A)) return true;
      A.pop_back();
   }
   if(P%100!=2) {
       A.push_front(x);
      if(pos==n) return true;
      if(can(pos+1,A)) return true;
      A.pop_front();
   }
   return false;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>tt;
    while(tt--){
        cin>>n;
        for(int i=1;i<=n;i++) cin>>a[i];
        sort(a+1,a+n+1);
        deque<ll> A;
        A.push_back(a[1]);
        A.push_back(a[2]);
        if(can(3,A)) cout<<"YES\n";
        else cout<<"NO\n";
     }

    return 0;
}
