Let be a natural number, and let S = \{ 1, 2, 3, \ldots, N \}. A function f : S \to S is called beautiful if there exists a bijective function g : S \to S such that for every in , the equation g(g(g(\ldots g(x) \ldots ))) = f(x) holds, where is applied exactly times.
You need to find the number of beautiful functions. Since the answer can be very large, print the result modulo .
The input consists of a single line containing the natural numbers and (N \leq 2000, d \leq 10^{18}).
Output the number of beautiful functions for the given and , modulo .
Example 1