Problem8811--[CSES Problem Set] Permutations II

8811: [CSES Problem Set] Permutations II

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

A permutation of integers 1,2,…,n is called beautiful if there are no adjacent elements whose difference is 1.
Given n, your task is to count the number of beautiful permutations.

Input

The only input line contains an integer n.

Output

Print the number of beautiful permutations of 1,2,…,n modulo $10^9+7$.

Constraints

$1 \leq n \leq 1000$

Sample 1 Input

5

Sample 1 Output

14

HINT

相同题目:CSES 1075

Source/Category