Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Magic Number

By JAKARIA_JK · Limits 1s, 256 MB

Jack loves to play with numbers. One day, while he was playing with numbers he found something interesting. He saw some numbers were indivisible without 1 and the number itself. He named those number as magic number.

Your task is to find whether the square root of a number is magic number or not.

Input

You will be given an integer T (1 ≤ T ≤ 40) in the first line. In the next T lines there will be an integer N (1 ≤ N ≤ 6.5 * 108).

Output

Print “YES.” if square root of N is a magic number else print “NO.” (w/o quotes).

Sample

InputOutput
4
4
9
16
36
YES.
YES.
NO.
NO.

Discussion

Statistics


67% Solution Ratio

JAKARIA_JKEarliest, Jul '19

JAKARIA_JKFastest, 0.0s

GeraltLightest, 0 B

jewel.samaShortest, 162B

Submit

Login to submit