The University of the Minas Heptagon is creating a new operating system, "Janelas OS", which will come installed with the famous game Minesweeper. To avoid legal trouble, they decided to make 1-D Minesweeper, a version different enough to calm down the competitors' lawyers. The game works as follows:

In the figure above, there are two example games for a given minefield. The one on the left ends in victory because all empty positions are found, and the one on the right ends in defeat because the player clicks a mine.
To help the university understand how long the game can entertain its users, given $$$N$$$, print how many different games can be played on a field of size $$$N$$$. Two games are considered different if the minefield is different, or if any move differs in order or position. Since the number of games can be very large, print the answer modulo $$$P$$$ – that is, the remainder of the division by $$$P$$$.
The input contains two integers $$$N$$$ ($$$1 \leq N \leq 3000$$$) and a prime $$$P$$$ ($$$5 \times 10^{8} \leq P \leq 10^{9}$$$), the size of the field and the modulo in which the answer should be printed, respectively.
The output should contain one integer, the number of possible games modulo $$$P$$$.
2 500000003
7
5 500000003
205
3000 999999733
842327137
Explanation for example 1
The possible games are: