#GYM104767J. Proglute

Proglute

本题没有可用的提交语言。

Description

Baroque opera geeks in Tomorrow Programming School are developing a new string instrument suitable for their innovative performances. The instrument, named programmed lute, or proglute in short, consists of flat circular body, with $N$ pegs situated on the body perimeter, and labeled by integers from $1$ to $N$.

Each string on the instrument is stretched between two different pegs and runs across the proglute's body without crossing other strings. To enhance complex resonance effects, the developers decided to attach two strings to all but two pegs, called principal pegs. Only one string is attached to each principal peg. To support glissando effects, the strings are arranged in such way that it is possible for a musician to touch the string at one principal peg and then slide the finger along all strings on the instrument to the other principal peg. While sliding, musician does not remove the finger from a string, and skips from a string to another one only at their common end peg.

To build the instrument, there are many ways to arrange the strings on the proglute. Different arrangement would result in different musical properties of the instrument. The developers want to know the number of all possible arrangements of strings on the proglute. They introduced the following notions.

  • The characteristic of a string is an unordered pair of labels of pegs at the string ends.
  • The characteristic of a proglute is the set of all its string characteristics.
  • Two strings arrangements on proglute are considered to be different when their corresponding characteristics are different.

Calculate the number of different string arrangements on the proglute.

The figure below shows two possible solutions for a proglute with five pegs:

The input consists of single line with an integer $N$ ($2 \leq N \leq 1000$), the number of the pegs on the proglute perimeter.

Output a single number equal to the number of mutually different arrangements of the strings on the proglute mod $10^9 + 7$.

Input

The input consists of single line with an integer $N$ ($2 \leq N \leq 1000$), the number of the pegs on the proglute perimeter.

Output

Output a single number equal to the number of mutually different arrangements of the strings on the proglute mod $10^9 + 7$.

5
666
20
61847156