Springs

No attempts yetTime limit1sMemory limit128 MB

Problem

You have a new collection of springs. Each spring was manufactured at a fixed length, and stretching or compressing it takes effort.

Changing the length of an untouched spring by 11 centimeter (either lengthening or shortening) costs 11 unit of effort. Every further 11-centimeter change of that same spring costs 11 more unit than the previous one. In other words, changing a single spring's length by a total of dd centimeters costs 1+2++d=d(d+1)21 + 2 + \dots + d = \frac{d(d+1)}{2} units of effort.

You want to know the minimum total effort needed to make the kk shortest springs all reach the same length. Every spring starts unstretched and uncompressed, and the common target length may be any integer you choose.

Input

The first line contains two integers nn and mm, the number of springs and the number of queries (1n,m1061 \le n, m \le 10^6).

The second line contains the spring lengths s1,s2,,sns_1, s_2, \dots, s_n in non-decreasing order (1sisi+11091 \le s_i \le s_{i+1} \le 10^9).

The third line contains mm queries k1,k2,,kmk_1, k_2, \dots, k_m (1kjn1 \le k_j \le n). Each query kjk_j concerns the kjk_j shortest springs.

Output

For each query jj, print on its own line the minimum total effort needed to make the kjk_j shortest springs the same length, taken modulo 109+710^9 + 7.