from math import isqrt for v in [1]*int(input()): input() for a in list(map(int, input().split())): v*=a print('YNeos'[v!=isqrt(v)**2::2])