Q=int(input()) from collections import Counter for _ in range(Q): N=int(input()) C=Counter([int(x) for x in input().split()]) flag=True for i in range(N): if C[i-1]!=2: flag=False if flag: print("Yes") else: print("No")