A KST is a search tree which has values in every node and children. For example, for a KST becomes a binary search tree. The values inside each node are sorted in ascending order. We will write for the value on the position of a node. The tree has the following property: for every node, its first child will contain smaller values than , the second child will contain values in the interval , the third child will contain values in the interval , , the penultimate child will contain values in the interval , and the last child will contain larger values than .
A node cannot have children if it does not contain values. The leaves can contain even fewer than values.
Task
Given – the number of elements and , the task is to find out how many such trees exist. The elements will be . For example, the following two trees are valid for and .
Input data
The first line contains the numbers and .
Output data
The first line will display how many such trees exist, modulo .
Constraints and clarifications
- For of the testcases, and .
- For another of the testcases, and .
- For another of the testcases, and .
Example 1
stdin
5 1
stdout
42
Example 2
stdin
5 2
stdout
16
Example 3
stdin
666 13
stdout
581769
Example 4
stdin
987 123
stdout
529937