from itertools import permutations
from math import factorial
for _ in range(int(input())):
    n = int(input())
    s = list(map(int, input().split()))
    s.sort()
    s = s[-1] + s[:-1]
    f = False
    for i in range(1, n - 1):
        if c[i - 1] + c[i + 1] < 2 *  c[i]:
            f = True
            break
    if f:
        print('NO')
    else:
        print('YES')
