405639: GYM102020 F Fairy, the treacherous mailman

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Fairy, the treacherous mailmantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Fairy is a very excentric mailman. Every now and then, he likes to change some correspondences that he is responsible for, swapping than to different addresses, as he enjoys the consequent turmoil. One day, Fairy was in his most inspired self and decided to swap all correspondences from their original addresses. No address should receive its intended correspondence. It will be Fairy's ultimate masterpiece. Although he is keen to chaos, Fairy is also a very curious person, and he asked himself about how many ways he could swap the correspondences so none of the addresses receive the correct message. As he's very lazy, he decided to ask your help to fulfill his objectives. You'll receive an integer number $$$N$$$, that stands for the correspondences amount, to which you should generate another integer $$$S$$$ that stands for the amount of ways he can swap the correspondences. Help Fairy in his mischievous plan, or he might change your correspondence as well.

Input

A unique integer $$$N$$$, ($$$1 \le N \le 20$$$) standing for the amount of correspondences.

Output

A unique integer $$$S$$$, representing the amount of ways Fairy can swap the correspondences. As the possibilities amount can be very big, the answer should be given as $$$S$$$ $$$mod$$$ $$$10^9+7$$$.

ExampleInput
3
Output
2

加入题单

算法标签: