Time limit: 1 second Memory limit: 256 MB Jamshid Kazemi (who is known by the pseudonym…
- User
Time limit: 1 second Memory limit: 256 MB Jamshid Kazemi (who is known by the pseudonym Kamran Pouriai), has recently become a man and was released from prison. Recently, people's traffic culture has annoyed and occupied his mind; A problem that cannot be solved.
Description of the image
He is now walking in Iranzmin Park. This park strangely consists of only one horizontal street consisting of almost countless consecutive blocks. Suppose that the block Jamshid is on is block number 0, and the blocks to his right are named 1, 2, and... respectively, and the blocks to his left are named -1, 2, and... respectively. . in n n blocks with different numbers a 1 , a 2 , . . . , a n a 1 , a 2 ,...,a n The flower has been planted. Every minute, Jamshid either goes one block to the right or one block to the left completely randomly; If he steps on a block that has flowers on it and hasn't been crushed yet, he will unknowingly crush the flowers on that block. He is total k He walks for k minutes. After realizing that the flowers are being crushed, to alleviate the damage he has done to the park, he wants to move for every possible mode. k k minutes (from 2 k 2 k Count the number of crushed flowers (different mode of going left and right in each minute) and then throw money into the fund of people's aid to the park equal to the sum of the number of crushed flowers in all modes. Since this number may become very large, he has decided to take the remainder of this number 1 0 9 + 7 10 9 Put 7 Tomans in the box. Help him and determine the amount he should pay to the fund.
input The first line of the input contains two integers n n and k k is Then in the next line n n different integers a 1 , a 2 , . . . , a n a 1 , a 2 ,...,a n has come 1 ≤ n , k ≤ 5
000 1≤n,k≤5000
5
000 ≤ a i ≤ 5
000 -5000≤a i ≤5 000 a i ≠ 0 a i
=0
output In the only output line, print the amount that Jamshid has to pay to the fund.
Example Sample entry 1 1 2 1 Plain text Sample output 1 2 Plain text Sample input 2 4 5 -1 3 2 4 Plain text Sample output 2 43
- Assistant