{"raw_statement":[{"iden":"statement","content":"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 #cf_span(class=[tex-font-style-underline], body=[profacts]). Alice calls a positive integer number a profact if it can be expressed as a product of one or several factorials.\n\nJust 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!\n\nThe 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).\n\nOutput 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_\".\n\nA #cf_span(class=[tex-font-style-underline], body=[factorial]) is any number that can be expressed as 1·2·3·...·k, for some positive integer k, and is denoted by k!.\n\n"},{"iden":"input","content":"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)."},{"iden":"output","content":"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_\"."},{"iden":"examples","content":"Input71238122425OutputYESYESNOYESYESYESNO"},{"iden":"note","content":"A #cf_span(class=[tex-font-style-underline], body=[factorial]) is any number that can be expressed as 1·2·3·...·k, for some positive integer k, and is denoted by k!."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ \\mathcal{F} = \\{ k! \\mid k \\in \\mathbb{Z}^+ \\} $ be the set of factorials.  \nA *profact* is a positive integer that can be expressed as a product of one or more elements from $ \\mathcal{F} $, i.e.,  \n$$\n\\mathcal{P} = \\left\\{ \\prod_{i=1}^m f_i \\mid m \\geq 1, \\, f_i \\in \\mathcal{F} \\right\\}.\n$$\n\n**Given**  \nLet $ n \\in \\mathbb{Z} $, $ 1 \\leq n \\leq 10^5 $, be the number of bills.  \nLet $ A = (a_1, a_2, \\dots, a_n) $, where each $ a_i \\in \\mathbb{Z} $, $ 1 \\leq a_i \\leq 10^{18} $, be the sequence of bill costs.\n\n**Objective**  \nFor each $ a_i \\in A $, determine whether $ a_i \\in \\mathcal{P} $.  \nOutput \"YES\" if $ a_i $ is a profact, otherwise output \"NO\".","simple_statement":"Alice has n bills with numbers on them. A number is called a \"profact\" if it can be written as a product of one or more factorials (like 1!, 2!, 3!, etc.). For each bill number, check if it is a profact. Print \"YES\" if it is, \"NO\" otherwise.","has_page_source":false}