Tutz likes math problems; this time he is trying to solve the following problem:
You are given K, S, T and are asked how many sequences of K integers (more formally a1, a2, a3, ⋯, aK) follow these rules:
- ai>0, for any i (1≤i≤K)
- a1+a2+a3+⋯+aK=S
- All subarrays of length T have the same product. More formally, a1⋅a2⋅a3⋅ … ⋅aT=a2⋅a3⋅a4⋅ … ⋅aT+1=⋯=aK−T+1⋅aK−T+2⋅aK−T+3⋅ … ⋅aK
You should find the number of such arrays modulo 109+7 (109+7 is a prime number).
The first line contains 3 integers K, S, T (1≤K,S,T≤5⋅106, K≥T).
Output data
Output one integer — the number of possible sequences modulo 109+7
Example 1
stdin
5 13 3
stdout
15
Explanation
The 15 sequences in the first example are:
[1,1,9,1,1] , [1,2,7,1,2] , [1,3,5,1,3] , [1,4,3,1,4] , [1,5,1,1,5] , [2,1,7,2,1] , [2,2,5,2,2] , [2,3,3,2,3] , [2,4,1,2,4] , [3,1,5,3,1] , [3,2,3,3,2] , [3,3,1,3,3] , [4,1,3,4,1] , [4,2,1,4,2] , [5,1,1,5,1]
Example 2
stdin
15 44 9
stdout
1162800