Timer is Running

Prime factorization and geek number
##### Submissions: 2538   Accuracy: 25.6%   Difficulty: Medium   Marks: 4

As we know that every number >=2 can be represented as natural powers of primes(prime factorization). Also prime factorization is unique for a number

Eg. 360 = 233251

Today we are interested in geek numbers. A geek number is a number whose prime factorization only contains powers of unity.Below are some geek numbers.

Eg. 2 = 21
22 = 21111

Input:

First line of the input file contains an integer T which denotes the number of test cases. Then T test cases follow. First line of each test case contains a number N.

Output:

For each test case, print "Yes"(without quotes) if it is a geek number, else print "No"(without quotes).

Constraints:
1<=T<=10000
2<=N<=106
Example:
Input:
2
22
360

Output:
Yes
No

#### ** For More Input/Output Examples Use 'Expected Output' option **

Author: gaurav miglani

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.