Degrees of permutations
Easy
Execution time limit is 4 seconds
Runtime memory usage limit is 64 megabytes
Let N be a natural number and let S = {1, 2, 3, ..., N}. A function f : S → S is considered beautiful if there exists a bijective function g : S → S such that for every x in S, the equation g(g(g(...g(x)...))) = f(x) holds true, where g is applied exactly d times.
Your task is to determine the number of beautiful functions. Since the result can be very large, you should provide the answer modulo 1000000009.
Input
The input consists of a single line containing the natural numbers N and d (N ≤ 2000, d ≤ 10^18).
Output
Output the number of beautiful functions for the given N and d, modulo 1000000009.
Examples
Input #1
Answer #1
Submissions 8
Acceptance rate 25%