from math import factorial
from random import shuffle

def check(m, n):
    #print(m)
    for i in range(1, n - 1):
        #print(m[i])
        if (2 * m[i]) > (m[i - 1] + m[i + 1]):
            return False
    return True

t = int(input())
for i in range(t):
    n = int(input())
    m = list(map(int, input().split()))
    c = round(1.3 * factorial(n))
    for i in range(c):
        if check(m, n):
            #print(m)
            print("YES")
            break
        if i == c - 1:
            print("NO")
            break
        shuffle(m)