Flags#9558

Flags

1 second
128 megabytes
Easy

The flag consists of vertical stripes, each of which can be colored white, red, or blue. Moreover:

How many ways are there to color a flag with stripes?

Input

One integer n~(1 \le n \le 10^6) — the number of stripes on the flag.

Output

Print the number of ways to color a flag with stripes. The answer should be given modulo 10^9 + 7.

Examples

Example 1

Loading
Loading