• + 0 comments
    for i in range(int(input())):
        n = int(input())
        p = list(map(int, input().split()))
        a = "Yes"
        for j in range(n//2):
            if max(p[j], p[~j]) < max(p[j+1], p[~(j+1)]):
                a = "No"
                break
        print(a)