409186: GYM103451 F Krosh and series sum 2
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
F. Krosh and series sum 2time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Krosh has given a new math homework: find the sum of the following series: $$$\sum\limits_{n = 1}^{\infty} \frac{(C_n^k) ^ 2}{2^n}$$$, where $$$k$$$ is given. Help him to find it for given $$$k$$$. It's guaranteed that answer is integer. Print it modulo prime number $$$10^9+7$$$.
InputYou are given integer $$$0 \le k \le 10^6$$$.
OutputPrint the series sum modulo $$$10^9+7$$$.
ExampleInput2Output
26Note
$$$C_n^k$$$ – number of ways to choose $$$k$$$ objects from $$$n$$$ objects.