Pudding is playing a game that has levels. There are a total of coins spread out among the levels. Specifically, th level has coins where form a permutation of . Pudding wants to pick all the coins in each level. However, her game character can only carry coins in a level where is the capacity of her bag. In level , and after completing each level, she stores the collected coins in a bank. Thus, the bag is emptied after each level and the capacity increases by . So if and the are , she will be able to take coins from the game.
Pudding knows that the game has levels. However, she doesn't know the permutation . She has many queries in mind. A query of asks how many permutations are there such that she will pick exactly coins after finishing the whole game. Note that in each level, she picks as many coins as she possibly can.
Help her answer these queries. But since the counts are huge, you have to output it modulo .
The first line of input will contain a positive integer (). The next line will contain a positive integer (), the number of queries. Each of the next lines will contain a positive integer (), the number of coins she will pick.
Output lines. The -th line will contain the answer to -th query.
Input | Output |
---|---|
3 3 6 4 10 | 1 3 0 |