t = int(input())

for i in range(t):
    n = int(input())
    foo = list(map(int, input().split()))
    for i in foo:
        if i != 0 and i < len(foo)-1 and foo[i]*2 => foo[i-1] + foo[i+1]:
            print('YES')
        else:
            print('NO')
