410095: GYM103940 L Limited Increasing Sequences

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. Limited Increasing Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Krystalova is studying a very particular sequence that she likes very much. Krystalova named the sequence: "Limited Increasing Sequence". A sequence $$$X$$$ of positive integer numbers is a limited increasing sequence if and only if every element $$$X_i$$$ is not greater than the sum of all the items $$$X_j$$$ $$$|$$$ $$$j < i$$$. In other words, every element $$$X_i$$$ meets the following condition:

$$$$$$\sum_{j=1}^{i-1}X_{j} \geq X_{i}$$$$$$

Let $$$f(X)$$$ be the sum of all the elements in a limited increasing sequence, it is said the limited increasing sequence $$$X$$$ produces $$$K$$$ if $$$f(X) = K$$$.

Looking at this sequence, Krystalova found that a number $$$K$$$ may be produced as the result of different $$$X$$$. She wants to know how many different limited increasing sequences produces $$$K$$$.

Help Krystalova to solve her problem!

Input

In the first line, you will have a single integer $$$K$$$ ($$$1 \leq K \leq 10^6$$$)

Output

Print a line with a single number with the result. As the answer might be very large, please output the answer modulo $$$10^9 + 7$$$

ExamplesInput
10
Output
84
Input
2022
Output
904964280
Input
3
Output
1

加入题单

算法标签: