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 1 centimeter (either lengthening or shortening) costs 1 unit of effort. Every further 1-centimeter change of that same spring costs 1 more unit than the previous one. In other words, changing a single spring's length by a total of d centimeters costs 1+2+⋯+d=2d(d+1) units of effort.
You want to know the minimum total effort needed to make the k shortest springs all reach the same length. Every spring starts unstretched and uncompressed, and the common target length may be any integer you choose.
The first line contains two integers n and m, the number of springs and the number of queries (1≤n,m≤106).
The second line contains the spring lengths s1,s2,…,sn in non-decreasing order (1≤si≤si+1≤109).
The third line contains m queries k1,k2,…,km (1≤kj≤n). Each query kj concerns the kj shortest springs.
For each query j, print on its own line the minimum total effort needed to make the kj shortest springs the same length, taken modulo 109+7.