- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to calculate the number of bit strings of length where each substring of length contains at least one 1.
Input
The only input line has two integers: and .
Output
Print one integer: the answer modulo .
Constraints
Example
Input:
3 2
Output:
5
Explanation: The valid strings are 010, 011, 101, 110 and 111.