for t in range(int(input())):
    n = int(input())
    ls = list(map(int,input().split()))
    ans1 = False
    for a in range(0,4):
        for b in range(0,4):
            for c in range(0,4):
                for d in range(0,4):
                    if a!=b!=c!=d:
                        l = [ls[a],ls[b],ls[c],ls[d]]
                        ans=False
                        for i in range(1,n-1):
                            if (l[i]*2<=l[i-1]+l[i+1]):
                                ans=True
                        if ans:
                            ans1=True
    if ans1:
        print("YES")
    else:
        print("NO")