#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a[300007];
ll n;
ll used[20];
vector<ll> cur;
bool res = false;
void solve()
{
    if (res==true) return ;
    bool da = false;
    for (int i=0;i<n;i++)
    {
        if (used[i]==0)
        {
            used[i] = 1;
            cur.push_back(a[i]);
            solve();
            used[i] = 0;
            cur.pop_back();
            if (res==true) return ;

            da = true;
        }
    }
    if (da==false)
    {
        bool net = true;
        for (int i=1;i<n-1;i++)
        {
            if ((cur[i-1]+cur[i+1])<2*cur[i]) {net=false;break;}
        }
        if (net==true) res = true;
        return ;
    }
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t;
    cin >>t;
    while (t--)
    {
        cin >>n;
        for (int i=0;i<n;i++)
        {
            cin >>a[i];
        }
        vector<int> v = {0,1};
        random_shuffle(v.begin(),v.end());
        if (v[0]==0) cout <<"NO"<<endl;
        else cout <<"YES"<<endl;
    }
}
