#P45. [KBC003E] Permutation

[KBC003E] Permutation

Source

This problem is adapted from Long Long OJ. All rights reserved.

Problem Description

There is a permutation aa of size nn, which satisfies a1=1a_1=1 and for each ii where 2in2\le i\le n, aiai12|a_i-a_{i-1}|\le2.

Given nn, find the number of possible such permutations.

Since the output may be extremely large, the answer should be taken modulo 109+710^9+7.

Input Format

The input consists of a single line containing an integer nn.

Output Format

Output the number of possible permutations.

Samples

4
4
32132
876675871

Sample 1 Explanation

The permutations are (1,2,3,4),(1,2,4,3),(1,3,2,4),(1,3,4,2)(1,2,3,4),(1,2,4,3),(1,3,2,4),(1,3,4,2).

Data Range

For 100% of the data: 1n10181\le n\le 10^{18}.