In the event of technical difficulties with Szkopuł, please contact us via email at email@example.com.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
Byteasar admires chess puzzles. He is a long-time subscriber of the Chess Player's Magazine. The most recent issue of this magazine contains the following puzzle:
A chessboard of size is given. In how many ways one can place rooks on the chessboard, so that no two rooks attack each other and the -th rook is located neither in the -th column nor in the -th row? The rooks, the rows and the columns are numbered from to . The result should be given modulo .
Puzzles of the type "mate in 13 moves" are a piece of cake for Byteasar, but this new type of puzzle seems very hard for him. Could you please help him?
The only line of input contains two integers and (, ).
Your program should output the number of possible placements of rooks.
For the input data:
the correct result is:
Task author: Tomasz Idziaszek.