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