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