Find the number of ways to achieve a given sum by rolling a die one or more times. Each roll can result in a number from to .
For example, if n = 3, there are different ways:
1 + 1 + 1
1 + 2
2 + 1
A single integer n~(1 \le n \le 10^6) will be given.
Calculate the number of ways modulo 10^9 + 7.
Example 1
Example 4
Example 5
Example 7