CSES - Permutations II | Hoán vị II

View as PDF



Problem types
Points: 1800 (p) Time limit: 1.0s Memory limit: 512M Input: stdin Output: stdout

Một hoán vị gồm \(1, 2, \ldots n\) được gọi là đẹp nếu không có các phần tử liền kề có chênh lệch là \(1\).

Cho \(n\), nhiệm vụ của bạn là đếm số lượng hoán vị đẹp.

Input

  • Dòng đầu vào duy nhất chứa một số nguyên \(n\).

Output

  • In số lượng hoán vị đẹp gồm \(1, 2, \ldots, n\) chia lấy dư cho \(10 ^ 9 + 7\).

Constraints

  • \(1 \leq n \leq 1000\)

Example

Sample input

5

Sample output

14


Comments

There are no comments at the moment.