#abc172e. [abc172_e]NEQ
[abc172_e]NEQ
Problem Statement
Count the pairs of length- sequences consisting of integers between and (inclusive), and , that satisfy all of the following conditions:
- , for every such that .
- and , for every such that .
Since the count can be enormous, print it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the count modulo .
Sample Input 1
2 2
Sample Output 1
2
and satisfy the conditions.
Sample Input 2
2 3
Sample Output 2
18
Sample Input 3
141421 356237
Sample Output 3
881613484