- Time limit: 0.50 s
- Memory limit: 512 MB
Kaaleppi will write a book of pages. There will be some chapters and sections, so that each chapter contains one or more sections, and each section consists of one or more pages.
For example, if , one possible structure is . In this case there are two chapters. The first chapter contains two sections with and pages, and the second chapter contains one section with pages.
Your task is to calculate the total number of possible structures for the book. Since the answer may be large, output it modulo .
Input
The only input line contains two integers and : the number of pages and the modulo.
Output
Print the total number of structures modulo .
Constraints
Example
Input:
3 123
Output:
9
Explanation: There are 9 possible structures: , , , , , , , and .