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:
import math
from bisect import bisect_left

#Se baso en una criba para crear una lista de número primos
#La búsqueda de la lista también se basó en una ayuda para su optimación
#Se dejaron las indicaciones encontradas sobre el código de la búsqueda en 
#caso de que sea necesario


def numerosPrimos(N):     #Criba para lista de número primos.
    numbers = [True, True] + [True] * (N-1)
    last_prime_number = 2
    i = last_prime_number
    
    while last_prime_number**2 <= N:
        i += last_prime_number
        while i <= N:
            numbers[i] = False
            i += last_prime_number
        j = last_prime_number + 1
        while j < N:
            if numbers[j]:
                last_prime_number = j
                break
            j += 1
        i = last_prime_number
    
    return [i + 2 for i, not_crossed in enumerate(numbers[2:]) if not_crossed]

N = numerosPrimos(1000000)

def binBusqueda(lst, item):
    """ efficient `item in lst` for sorted lists """
    # if item is larger than the last its not in the list, but the bisect would 
    # find `len(lst)` as the index to insert, so check that first. Else, if the 
    # item is in the list then it has to be at index bisect_left(lst, item)
    return (item <= lst[-1]) and (lst[bisect_left(lst, item)] == item)

n = input() #cantidad de datos a ingresar
n = int(n)

A = []    # entradas
S = []    # salidas

A = map(int,input().split(" "))

for i in A:
  if i < 4:
    S.append("NO")
    
  elif i==4:
    S.append("YES")
  
  else:
    r = math.sqrt(i)
    V = r==r//1
    P = binBusqueda(N,int(r))

    if V and P:
      S.append("YES")

    else:
      S.append("NO")

for i in S:
  print(i)