from collections import defaultdict n=int(input()) for i in range(n): a=int(input()) t=list(map(int,input().split())) dic = defaultdict(int) f=0 ans=0 for j in range(a*2): dic[t[j]] += 1 if dic[t[j]] > 2: f=1 break ind= j+1 if ind > a: ind -= a tt=abs(t[j]-ind) ans=max(ans,tt) if ans > a-2: f = 1 print('No' if f == 1 else 'Yes')