402517: GYM100796 K Profact
Description
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!
InputThe 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).
OutputOutput 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".
ExamplesInput7Output
1
2
3
8
12
24
25
YESNote
YES
NO
YES
YES
YES
NO
A factorial is any number that can be expressed as 1·2·3·...·k, for some positive integer k, and is denoted by k!.