Marcel has recently taken up a new hobby: creating zen gardens. He quickly developed his own style, that uses stones as garden features. Half of the stones are green (they are covered in moss) and are uniquely numbered from to , while the other half are grey (no moss grows on them) and are likewise uniquely numbered from to . To create a garden, Marcel will take the stones and place them in some order in a straight line, making sure the distance between any two consecutive stones is precisely inch.
When it comes to judging the aesthetic appeal of a garden, all gardens are considered beautiful. However, there is one superstition that Marcel has about his gardens: if the distance between two stones that have the same number written on them is equal to a multiple of inches, then the garden is considered unlucky, bringing great misfortune and Code::Blocks
crashes upon the one who created that garden. Marcel will never create such a garden. Naturally, all other gardens are considered lucky.
Task
As part of his journey to reach enlightenment, Marcel has set out to create all the lucky gardens that can be created. However, as he is also a forethoughtful and well organized individual, Marcel would like to know how many lucky gardens consisting of stones exist before he embarks on his journey. Two gardens and are considered different if there exists an integer , such that:
- the colour of the th stone in garden is different from the colour of the ith stone in garden , or
- the number written on the th stone in garden is different from the number written on the th stone in garden .
Input data
The first and only line of the input contains two integers and , meaning that Marcel will create gardens with stones which are lucky.
Output data
On a single line, output the number of lucky gardens that contain stones, modulo .
Restrictions
# | Points | Restrictions |
---|---|---|
1 | 9 | |
2 | 12 | |
3 | 13 | |
4 | 18 | |
5 | 48 | No further restrictions. |
Example 1
stdin
100 23
stdout
171243255
Example 2
stdin
1 1
stdout
0
Explanation
In the second example, two gardens can be created. However, no garden is -lucky, as for both gardens the distance between the stones numbered with is inch, which is a multiple of inches.