Never mix up your hat!#8514

Never mix up your hat!

2 sekundi
64 megabajtov
Lahko

Mahmoud and his friends visited Georgia. They planned to stay in a hotel at Rustavelli. When the cowboys reached the hotel, they hung their hats in the entrance and settled in. When it was time to leave for an event downtown, everyone hurriedly grabbed a hat from the entrance. In the rush and excitement, nobody paid attention, so the hats became mixed up.

A cowboy who wears his own hat is considered clever, and one who fails to do so is considered silly.

You are given the number of cowboys (including Mahmoud). You should find in how many ways the cowboys may put on hats such that all of them are silly (i.e., no one wears their own hat). Two ways are considered different if there is at least one cowboy who has a different hat in each way.

As the answer may become very large, you should output the result modulo 10^9 + 7.

Vhod

Given the number of cowboys (1 \leq n \leq 10^7).

Izhod

Output the answer to the problem as specified above.

Primeri

Primer 1

Loading
Loading

Primer 4

Loading
Loading