Stevie: "Math is so much fun". Also, finally a player that is still at Liverpool :
You are given a number K expressed as a product of a given array A of N integers. In short, K=∏Ni=1A[i] . Now, in addition, you are also given 2 functions that are :
G(i) = smallest divisor of number i greater that 1
F(i) : 0, if i=1.
else F(i) = (1+F(i/G(i)))
Now, you need to answer Q queries. In each query, you shall be given a single number Y. You need to find the sum of all numbers X, such that K is divisible by X. and F(X)=Y
As the answer to this can be rather large, print it Modulo 109+7.
Input Format :
The first line contains 2 space separated integers N and Q. The next line contains N space separated integers, where the ith integer denotes A[i].
Each of the next Q lines contains a single integer Y.
Output Format:
Print the answer to each query on a new line Modulo 109+7
Constraints :
1≤N≤5×104
1≤Q≤104
0≤Y≤104
1≤A[i]≤105
Worth 40% of the total score :
1≤N,A[i],Y,Q≤5000
The divisors of the number 36 are :
[1,2,3,4,6,9,12,18,36]