• + 0 comments
    for t in range(int(input())):
        n = int(input())
        lst = list(map(int, input().split()))
        result = 'Yes'
        previous_item = None
        while lst:
            if lst[0] >= lst[-1]:
                current_item = lst.pop(0)
            else:
                current_item = lst.pop(-1)
            if previous_item:
                if current_item > previous_item:
                    result = 'No'
                    break
            previous_item = current_item
        print(result)