Combinations of Dice#361

Combinations of Dice

1 second
128 megabytes
Medium (≈1350)

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:

Input

A single integer n~(1 \le n \le 10^6) will be given.

Output

Calculate the number of ways modulo 10^9 + 7.

Examples

Example 1

Loading
Loading

Example 4

Loading
Loading

Example 5

Loading
Loading

Example 7

Loading
Loading