def f(): N = int(input()) A = list(map(int,input().split())) for i in range(1,2*N): if A[i]==A[i-1]:return 'No' return 'Yes' T = int(input()) for i in range(T):print(f())