2-3 Trees#4668

2-3 Trees

1 second
256 megabytes
Very easy

- tree is an elegant data structure invented by John Hopcroft. It is designed to implement the same functionality as the binary search tree. - tree is an ordered rooted tree with the following properties:

The only exception is the tree that contains exactly one vertex — in this case the root of the tree is the only vertex, and it is simultaneously a leaf, i.e. has no children. The main idea of the described properties is that the tree with leaves has the height O(\log l).

Given the number of leaves there can be several valid - trees that have leaves. For example, the picture below shows the two possible - trees with exactly leaves.

Given find the number of different - trees that have leaves. Since this number can be quite large, output it modulo .

Input

Input file contains two integer numbers: and (1 \le l \le 5000, 1 \le r \le 10^9).

Output

Output one number — the number of different - trees with exactly leaves modulo .

Examples

Example 1

Loading
Loading