import itertools
import sys
def res(a):
    q=list(itertools.permutations(a))
    for i in q:
        k=True
        for j in range(1,len(i)-1):
            if i[j-1]+i[j+1]>=i[j]*2:
                k=True
            else:
                k=False
                break
            if k:
                return('YES')
            else:
                return('NO')
t = int(sys.stdin.readline())
for _ in range(t):
    n=int(input())
    a=list(map(int,input().split()))
    print(res(a))