#P1436C. Binary Search
Binary Search
Description
Andrey thinks he is truly a successful developer, but in reality he didn't know about the binary search algorithm until recently. After reading some literature Andrey understood that this algorithm allows to quickly find a certain number in an array. For an array indexed from zero, and an integer the pseudocode of the algorithm is as follows:

Note that the elements of the array are indexed from zero, and the division is done in integers (rounding down).
Andrey read that the algorithm only works if the array is sorted. However, he found this statement untrue, because there certainly exist unsorted arrays for which the algorithm find !
Andrey wants to write a letter to the book authors, but before doing that he must consider the permutations of size such that the algorithm finds in them. A permutation of size is an array consisting of distinct integers between and in arbitrary order.
Help Andrey and find the number of permutations of size which contain at position and for which the given implementation of the binary search algorithm finds (returns true). As the result may be extremely large, print the remainder of its division by .
The only line of input contains integers , and (, ) — the required length of the permutation, the number to search, and the required position of that number, respectively.
Print a single number — the remainder of the division of the number of valid permutations by .
Input
The only line of input contains integers , and (, ) — the required length of the permutation, the number to search, and the required position of that number, respectively.
Output
Print a single number — the remainder of the division of the number of valid permutations by .
Note
All possible permutations in the first test case: , , , , , .