With the college fest approaching soon, Manasa is following a strict dieting regime . Today, she just cannot resist her temptation for having a pizza. An inner conflict ensues, and she decides that she will have a pizza, only if she comes up with a solution to the problem stated below. Help her get the pizza for herself.
Given a list L of N numbers, where
L = { a1, a2, a3, a4 .... , aN}
Find the value of M that is computed as described below.
Input Format
The first line contains an integer N i.e. size of the list L.
The next line contains N space separated integers, each representing an element of the list L.
Output Format
Print the value of M _modulo (109 + 7)_.
Constraints
1 ≤ N ≤ 5100
0 ≤ ai ≤ 1015 , where i ∈ [1 .. N]
Sample Input 00
3
1 2 3
Sample Output 00
40392
Explanation
There are 8 subsets of given set,
- S = {1,2,3} and L - S ={0} value of F(6) = 19601
- S = {1,2} and L - S ={3} value of F(0) = 1
- S = {1,3} and L - S ={2} value of F(2) = 17
- S = {2,3} and L - S ={1} value of F(4) = 577
- S = {1} and L - S ={2,3} value of F(4) = 577
- S = {2} and L - S ={1,3} value of F(2) = 17
- S = {3} and L - S ={1,2} value of F(0) = 1
- S = {} and L - S ={1,2,3} value of F(6) = 19601
Adding all these values, we get M = 40392.