405832: GYM102133 C Auction

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

Description

C. Auctiontime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

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.

Input

First 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.

1 ≤ t ≤ 42
2 ≤ ni ≤ 1018
Output

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.

ExampleInput
1
42
Output
YES

加入题单

算法标签: