LogiQuest

265. Domino Tiling 2×N

EasyDynamic Programming

Count the ways to tile a 2×n board with 2×1 dominoes. Print modulo 10⁹ + 7.

Input format

A single integer n.

Output format

The count mod 10⁹ + 7.

Example 1

Input

1

Output

1

Example 2

Input

2

Output

2

Constraints

1 ≤ n ≤ 10⁶

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…