#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define el '\n'
#define ff first
#define ss second
#define pii pair <ll, ll>
#define pb push_back
#define popb pop_back
#define fr(x, l, r) for(ll (x) = l; (x) <= r; (x)++)
#define frb(x, r, l) for(ll (x) = r; (x) >= l; (x)--)

mt19937_64 rnd(time(0));

ll const N = 2e3 + 10;
ll const INF = 1e18 + 100;

ll a[N];
bool dp[2][N][N], nxt[2][N][N];

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

    fr(i, 1, n) {
        cin >> a[i];
        fr(t, 0, 1)
            fr(j, 0, i)
                fr(k, 0, i) 
                    dp[t][j][k] = 0;
        fr(t, 0, 1)     
            fr(j, 0, i)
                fr(k, 0, i) 
                    nxt[t][j][k] = 0;
    }

    sort(a + 1, a + n + 1);
    ll mn = a[1];
    fr(i, 1, n)
        a[i] -= mn;

    dp[0][0][0] = 1;
    fr(i, 1, n - 1) {
        fr(t, 0, 1) {
            fr(x, 0, i) {
                fr(x2, 0, i) {
                    if(!dp[t][x][x2]) continue;
                    
                    if(t) {
                        // new same
                        // dp[i + 1][1][x][x2]
                        if(a[i + 1] - a[i] >= a[i] - a[i - 1])
                        nxt[1][x][x2] = 1;
                        
                        // new dif
                        // dp[i + 1][0][x][i - 1] 
                        if(a[i + 1] - a[x] >= a[x] - a[x2])
                        nxt[0][x][i - 1] = 1;
                    }
                    else {
                        // new same
                        // dp[i + 1][1][i - 1][x2]
                        if(a[i + 1] - a[i] >= a[i] - a[x])
                        nxt[1][i - 1][x2] = 1;
                        
                        // new dif
                        // dp[i + 1][0][i - 1][x]
                        if(a[i + 1] - a[i - 1] >= a[i - 1] - a[x2])
                        nxt[0][i - 1][x] = 1;
                    }
                }
            }
        }
        fr(t, 0, 1) {
            fr(j, 0, i) {
                fr(k, 0, i) {
                    dp[t][j][k] = nxt[t][j][k];
                    nxt[t][j][k] = 0;           
                }
            }
        }
    }

    fr(t, 0, 1)
        fr(x, 0, n - 1)
            fr(x2, 0, n - 1)
                if(dp[t][x][x2])
                    return void(cout << "YES" << el);
    cout << "NO" << el;
}

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

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