P=[] prime = [True for i in range(10**8+1)] p = 2 while (p * p <= 10**8+1): if prime[p] ==1: P.append(p) for i in range(p * 2, 10**8+1, p): prime[i] = 0 p += 1 S=set(P) l=len(P) t=int(input()) for _ in range(t): n=int(input()) flag=0 for i in range(l): if n%P[i]==0: n//=P[i] for j in range(i,l): if n%P[j]==0: n//=P[j] if n in S: flag=1 break if flag: break print("Yes" if flag else "No")