There are floors in a building and buttons in a lift. The floors are indexed from to .
You live in the floor. You want to stay alone in the lift. This is not possible because many people live in the building.
At the first floor, many people get into the lift and press the button for their destination floor. Assume that the buttons that are pressed are . Note that the floor button is always pressed because you are still in the lift.
The happiness value is defined as follows:
If a button represents the floor number that is greater than or equal to is pressed and no button that contains a number that is strictly smaller than is pressed, then the value of the button is .
If no button contains a number that is strictly greater than , then its value is where is the second-largest number on the buttons that are pressed.
Otherwise the value is .
Determine the total happiness value of every situations modulo . Each button can be pressed or not be pressed.
Input Format
The first line contains two integers ()
Output Format
Print the answer modulo .
If 1 pressed 2 pressed 3 pressed, the happiness is 0
If 1 pressed 2 pressed 3 not pressed, the happiness is 1
If 1 not pressed 2 pressed 3 pressed, the happiness is 2
If 1 not pressed 2 pressed 3 not pressed, the happiness is 2