• + 1 comment

    '''if the largest block isn't in the first or last position to begin with, the blocks are not stackable'''

    for _ in range(int(input())): n = int(input()) blocks = list(map(int, input().split())) if blocks[0] == max(blocks) or blocks[-1] == max(blocks): print("Yes") else: print("No")