Five-Dimensional Chocolate

Count the ways to tile a 2x2x2x2xn five-dimensional box with 1x1x1x1x2 domino pieces, modulo 1000000007.

Hard8Dynamic programmingMathCombinatoricsNo attempts yetTime limit2sMemory limit512 MB

Problem

A chocolate bar of size 2×2×2×2×n2 \times 2 \times 2 \times 2 \times n sits in a five-dimensional world. It consists of 16n16n unit cubes.

You want to cut it into 8n8n pieces of size 1×1×1×1×21 \times 1 \times 1 \times 1 \times 2. Write a program that counts the ways to cut it.

The orientation of a piece does not matter, so 1×1×1×2×11 \times 1 \times 1 \times 2 \times 1 and 2×1×1×1×12 \times 1 \times 1 \times 1 \times 1 are possible sizes too. Two ways are counted as different when some piece covers a different pair of unit cubes.

Input

The first line contains nn (1n1091 \le n \le 10^9).

Output

Print the number of ways modulo 109+710^9+7 on the first line.