2 by n Tiling

Count the ways to tile a 2 by n rectangle with 1 by 2 dominoes and print the count modulo 10007.

Easy3Dynamic programmingInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

Write a program that counts the ways to fill a 2 by nn rectangle completely with 1 by 2 tiles and 2 by 1 tiles. Tiles may not overlap and may not stick out of the rectangle.

The picture below shows one way to fill a 2 by 5 rectangle.

Input

The first line contains nn. (1n1,0001 \le n \le 1{,}000)

Output

Print the number of ways to fill the 2 by nn rectangle, modulo 10,00710{,}007, on the first line.