Exercise
문제
Farmer John has come up with a new morning exercise routine for the cows (again)!
As before, Farmer John's cows () are standing in a line. The -th cow from the left has label for each . He tells them to repeat the following step until the cows are in the same order as when they started.
- Given a permutation of length , the cows change their order such that the -th cow from the left before the change is -th from the left after the change.
For example, if then the cows perform one step. If , then the cows perform six steps. The order of the cows from left to right after each step is as follows:
- 0 steps:
- 1 step:
- 2 steps:
- 3 steps:
- 4 steps:
- 5 steps:
- 6 steps:
Find the sum of all positive integers such that there exists a permutation of length that requires the cows to take exactly steps.
As this number may be very large, output the answer modulo (, is prime).
입력
The first line contains and .
출력
A single integer.
힌트
There exist permutations that cause the cows to take , , , , , and steps. Thus, the answer is .
예제
예제 1
5 1000000007
21