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

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