company X has n servers. The cache
optimization power of the ft server is powerit.
The cache optimization power of a group of
contiguous servers /I,r] is defined as

Returns:
int: the sum of the powers of all possible
contiguous groups of servers, modulo (10 + 7)
ALL
Constraints
1<=n<=8*10^5
1 < power[i]≤10^ 9
Find the sum of Power.r for each possible
contiguous group of servers. Since, the answer
can be very large, return the answer
modulo 1000000007(109 + 7).
Example:
power = [2, 3, 2, 11
There are n = 4 servers. The powers of
contiguous groups of servers are:
Power [0,0] = min([2])
sum ( [2])
= 2 * 2:
4
Power [0,1] = min([2, 3])
sum([2, 3])
=2 * 5 = 10
Power [0,2] = min([2, 3, 21)
Sample Input For Custom Testing
STDIN
FUNCTION
3
power I size n= 3
2
power = [2g 1, 3]
1
3
Sample