402517: GYM100796 K Profact

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. Profacttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Alice is bored out of her mind by her math classes. She craves for something much more exciting. That is why she invented a new type of numbers, the profacts. Alice calls a positive integer number a profact if it can be expressed as a product of one or several factorials.

Just today Alice received n bills. She wonders whether the costs on the bills are profact numbers. But the numbers are too large, help Alice check this!

Input

The first line contains a single integer n, the number of bills (1 ≤ n ≤ 105). Each of the next n lines contains a single integer ai, the cost on the i-th bill (1 ≤ ai ≤ 1018).

Output

Output n lines, on the i-th line output the answer for the number ai. If the number ai is a profact, output "YES", otherwise output "NO".

ExamplesInput
7
1
2
3
8
12
24
25
Output
YES
YES
NO
YES
YES
YES
NO
Note

A factorial is any number that can be expressed as 1·2·3·...·k, for some positive integer k, and is denoted by k!.

加入题单

算法标签: