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