Problem: We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer t Т-prime, if t has exactly three distinct positive divisors.

You are given an array of n positive integers. For each of them determine whether it is Т-prime or not.

Input

The first line contains a single positive integer, n (1 ≤ n ≤ 105), showing how many numbers are in the array. The next line contains n space-separated integers xi (1 ≤ xi ≤ 1012).

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is advised to use the cin, cout streams or the %I64d specifier.

Output

Print n lines: the i-th line should contain "YES" (without the quotes), if number xi is Т-prime, and "NO" (without the quotes), if it isn't.

Examples

Input

3
4 5 6


Output

YES
NO
NO

Note

The given test has three numbers. The first number 4 has exactly three divisors — 1, 2 and 4, thus the answer for this number is "YES". The second number 5 has two divisors (1 and 5), and the third number 6 has four divisors (1, 2, 3, 6), hence the answer for them is "NO".

Solution (in PYTHON3):

Solution:
"""
pr = list(range(2,1000))

prime = []
t_prime = []
while pr != []:
    prime.append(pr[0])
    for i in pr:
        if int(i) %  int(prime[-1]) == 0:
            pr.remove(i)
t_prime = list(map(lambda x: x**2,prime))
input()
for d in map(int,input().split()):
    print(['NO','YES'][d in t_prime])
"""
"""
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]


n = int(input())
a = []
a.extend(map(int, input().split()))
for i in range(n):
    b = int(a[i])**(1/2)
    t = 1
    if b != int(b) or b**(1/2) == int(b**(1/2)) 0:
        print("NO")
        continue
    for num in prime:
        if int(a[i])**(1/4)<int(num):
            continue
        if int(a[i])**(1/2)%int(num)==0:
            t=0
    if t==1:
        print("YES")
    else:
        print("NO")
"""


n = int(1000000)
prime = [1]*n
s = set()

for i in range(2,n):
    if prime[i]:
        prime[i*i:n:i]=[0]*len(prime[i*i:n:i])
        s.add(i*i)
input()
[print("YES") if d in s else print("NO") for d in map(int,input().split())]





"""

#Answer1

 n=2**20
a=[1]*n
r={4}
for i in range(2,n):
    if a[i]:
        for j in range(i*i,n,i):
            a[j]=0
        r.add(i*i)
input()
for d in map(int,input().split()):
    print (['NO','YES'][d in r])

#Answer2

N=1000000
a=[1]*N
a[0]=a[1]=0
s=set()
for i,x in enumerate(a):
  if x:
    s.add(i*i)
    for j in range(i+i,N,i):
      a[j] = 0
input()
for x in map(int,input().split(" ")):
  print("YES" if x in s else "NO")

#Answer3
def sieve(n):
    np1 = n + 1
    s = list(range(np1))
    s[1] = 0
    sqrtn = int(round(n**0.5))
    for i in range(2, sqrtn + 1):
        if s[i]:
            s[i*i: np1: i] = [0] * len(range(i*i, np1, i))
    return filter(None, s)
n = int(input())
listOfNum = [int(i) for i in input().split()]
prime = set(sieve(int((max(listOfNum))**0.5)+1))
for item in listOfNum:
    s = item**0.5
    if int(s)==s and s in prime:
        print('YES')
    else:
        print('NO')

"""