Types: N: int, D: int, X: int  
Ranges: 1 ≤ N ≤ 2,000, 1 ≤ D ≤ 10^12, 1 ≤ X ≤ 2,000  
Addtl Info: The input consists of multiple datasets, with no more than 100 datasets. The end of input is denoted by a line that contains three zeros. The output should be the number of ways modulo 1,000,000,007.