import sys

n = int(sys.stdin.readline())

for i in range(n):
    large = int(sys.stdin.readline())
    array = list(map(int, sys.stdin.readline().split()))
    result = [0 for j in range(large)]
    turn = False
    right = large - 1
    left = 0
    for j in range(large):
        maxNum = max(array)
        indexToRemove = array.index(maxNum)
        if not turn:
            result[right] = maxNum
            right -= 1
            turn = True
        else:
            result[left] = maxNum
            left += 1
            turn = False
        array.pop(indexToRemove)
    allFine = True
    for j in range(1, large - 1):
        if result[j] * 2 > result[j - 1] + result[j + 1]:
            allFine = False
            break
    if allFine: print("YES")
    else: print("NO")