The SIA (Soteropolis Intelligence Agency) has just engaged in a new operation code-named Hummingbird. It is responsible for the investigation of illegal biological activities in greater Soteropolis area. Tico is the one responsible for building a team for the operation. $$$n$$$ agents will be designated to it, but first they must be given code names and then be arranged hierarchically.
More specifically, Tico will arrange those $$$n$$$ agents in a line and number them from 1 to $$$n$$$, left to right. Right after that he will pick a code name for each one of the agents. The agent $$$i$$$ will receive a non-empty code name with at most $$$a_i$$$ characters. A code name is a string composed of:
Tico says that the strong character of a code name is the special character which is greater than all the others. For example, if we take $$$S$$$ as the set of English characters, the strong character of 4ak2k is k.
After that, Tico will choose a direct supervisor for each of the agents in such a way that the following properties are met:
Tico defines a team as a pair of sequences $$$(g, p)$$$ such all the properties above are met, where $$$g_i$$$ is the code name of the $$$i$$$-th agent and $$$p_i$$$ is the supervisor of the $$$i$$$-th agent (or 0 if he is the team leader).
Tico is interested in counting how many distinct teams he can get by picking code names and supervisors for the agents. More specifically, he wants to count that for many different sets $$$S$$$.
Two teams $$$(g, p), (t, s)$$$ are considered different iff there is an agent $$$i$$$ such that $$$g_i \neq t_i$$$ or $$$p_i \neq s_i$$$.
The first line contains two integers $$$n, Q$$$ ($$$1 \leq n \leq 50$$$; $$$1 \leq Q \leq 50000$$$) – the number of agents and the number of sets $$$S$$$ to be considered.
The second line contains $$$n$$$ integers. The $$$i$$$-th of them is $$$a_i$$$ ($$$1 \leq a_i \leq 5$$$) – the maximum length of the code name of the $$$i$$$-th agent.
Then $$$Q$$$ lines follow. The $$$i$$$-th of them contains the size $$$|S_i|$$$ of a set of special characters ($$$1 \leq |S_i| \leq 10^9$$$).
Print $$$Q$$$ lines with a single integer in each one of them. The $$$i$$$-th of those should contain how many distinct teams can be formed considering $$$S_i$$$ as the set of special characters.
Since those numbers can be huge, you should print the module $$$10^9+7$$$.
1 2
1
1
2
1
2
1 3
2
1
2
3
22
46
72
3 2
2 3 1
5
10
2540038
28724476
In the first case, the only possible code names for $$$|S|$$$ = 2 are a and b.
In the second case, for $$$|S| = 1$$$ we have the following strings in regex notation:
Summing up to 22 possible code names.
| Name |
|---|


