from math import isqrt def solve(): n=int(input()) a=list(map(int,input().split())) tmp=1 for i in a: tmp*=i s=isqrt(tmp) if s*s==tmp: print('Yes') else: print('No') for _ in range(int(input())): solve()