from heapq import heappop,heappush def solve(): n = int(input()) A = list(map(int,input().split())) use = [0]*n h = [] for i,a in enumerate(A): heappush(h,[a,i]) while h: c,ind = heappop(h) if A[ind]!= c: continue if A[ind]: return "No" use[ind] = 1 ni = (ind+1)%n if use[ni] == 0: A[ni] -= 1 if A[ni] < 0: return "No" heappush(h,[A[ni],ni]) ni = (ind-1)%n if use[ni] == 0: A[ni] -= 1 if A[ni] < 0: return "No" heappush(h,[A[ni],ni]) return "Yes" if sum(A) == 0 else "No" t = int(input()) for _ in range(t): print(solve())