#c22906. Magic Gems
Magic Gems
Magic Gems
Problem Source
Codeforces 1117D.
Problem Description
Reziba has an infinite number of magic gems, each of size unit. Each magic gem can be decomposed into ordinary gems, each also of size unit.
Now Reziba needs to choose some magic gems and decompose some of them, so that the resulting gems exactly fill units of space. How many different selection-and-decomposition schemes are there? Output the answer modulo . (Two schemes are considered different if the number of chosen magic gems differs, or if the magic gems decomposed differ in their positions within the sequence.)
Input Format
The first line contains two integers .
Output Format
Output one integer — the answer modulo .
Sample Input
4 2
Sample Output
5
Constraints
For of the test cases, and .