CF 預處理

K. Profact

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard 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".

Examples

input

7
1
2
3
8
12
24
25

output

YES
YES
NO
YES
YES
YES
NO

Note

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


http://codeforces.com/gym/100796/problem/K

題目大意:

一個數字,如果可以組成若干個階乘的和,那麼就輸出yes,反之輸出no



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章