Given n integers a1,a2,…,an, Bobo knows how to compute the sum of triples S3=∑1≤i<j<k≤naiajak.
It follows that S3=(∑1≤i≤nai)3−3(∑1≤i≤na2i)(∑1≤i≤nai)+2(∑1≤i≤na3i)6.
Bobo would like to compute the sum of quadrangles \left(\sum_{1 \leq i < j < k < l \leq n} a_i a_j a_k a_l\right)\bmod (10^9+7).
Input
The input contains zero or more test cases and is terminated by end-of-file. For each test case,
The first line contains an integer n.
The second line contains n integers a_1, a_2, \dots, a_n.
- 1 \leq n \leq 10^5
- 0 \leq a_i \leq 10^9
- The number of tests cases does not exceed 10.
Output
For each case, output an integer which denotes the result.
Sample Input
3 1 2 3 4 1 2 3 4 5 1 2 3 4 5
Sample Output
0 24 274