Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/kombinatorika-davra-stoli

Round table

Easy 1000 ms 128 MB 28%
Share

$n$ guests sit down at a round table; there are $n$ seats around the table. Seatings that differ only by a rotation are considered the same (if every guest has the same left and right neighbours, the seatings are the same). How many different seatings are there? Print the answer modulo $10^{9} + 7$.

Guests around a round table; two seatings that differ by a rotation are the same

Input

One positive integer $n$.

Output

One integer — the number of seatings modulo $10^{9} + 7$.

Note

$1 \le n \le 10^{6}$

Examples

Input #1
4
Output #1
6
Input #2
1
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.