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:
def f1(n=10**6):
    a=[False,True]*(n//2+1)
    y=[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]
    b=[166666, 99998, 71426, 45450, 38456, 29404, 26307, 21728, 17227, 16114, 13496, 12175, 11607, 10615, 9408, 8446, 8167, 7430, 7007, 6813, 6290, 5983, 5574, 5107, 4901, 4803, 4620, 4533, 4369, 3874, 3752, 3582, 3528, 3282, 3236, 3107, 2986, 2911, 2804, 2704, 2672, 2523, 2495, 2440, 2414, 2265, 2131, 2090, 2069, 2030, 1973, 1955, 1867, 1818, 1770, 1725, 1710, 1667, 1639, 1626, 1560, 1476, 1453, 1441, 1419, 1346, 1316, 1268, 1259, 1240, 1214, 1179, 1154, 1130, 1114, 1091, 1061, 1047, 1018, 984, 978, 945, 939, 920, 908, 890, 866, 855, 849, 838, 805, 784, 773, 753, 743, 728, 700, 695, 654, 641, 620, 607, 595, 591, 579, 559, 547, 536, 532, 521, 510, 502, 499, 477, 460, 457, 450, 440, 430, 426, 407, 401, 391, 379, 363, 351, 336, 325, 316, 308, 302, 291, 283, 277, 266, 261, 242, 229, 214, 212, 199, 197, 192, 189, 177, 160, 155, 153, 148, 132, 128, 125, 121, 98, 94, 85, 74, 66, 61, 55, 49, 34, 30, 24, 18, 10, 4]

    for y,b in zip(y,b):
        a[y*y::y+y]=[False]*b

    return [4]+[i**2 for i in range(3,10**6,2) if a[i]]

def main():
    n=int(input())
    x=list(map(int,input().split()))
    z=set(f1())
    print('\n'.join(['YES' if x in z else 'NO' for x in x]))

if __name__=='__main__':
    main()