405832: GYM102133 C Auction
Description
Famous yacht company "Boats, boats, boats" have decided to sell their products using so called paired auction to increase their sales amount. Only two customers are taking part in this kind of auctions and the procedure differs from classical auctions. The initial price of a yacht is 1 ruble and then during each step one of the customers is multiplying current price by a integer number from 2 to 9. The bidding process is going on while current price does not exceed n rubles, which is known in advance. Thus, customer made last bid will get the yacht for 1 ruble only and the other customer will have to pay the full yacht price n rubles, accordingly.
You are a rich man and you have decided to take part in t paired auctions. Therefore, your finance managers have to determine the outcome for each auction knowing the actual price of the yacht ni. Outcome is the chance to buy a yacht for 1 ruble if you and another customer are doing optimal bids. Furthermore, you always start the paired auction, i.e. increasing the price during the first round.
InputFirst line contains positive integer t – number of paired auctions you are taking part in.
Each of the next t lines contain only one positive integer ni – actual price for each of auctions, accordingly.
You should output exactly t strings. Each of them contains "YES" (without quotation marks) if you can buy a yacht for 1 ruble during the auction and "NO" otherwise.
ExampleInput1Output
42
YES