Sum of odd-indexed Fibonacci numbers

Given n up to 1e18, compute the sum of odd-indexed Fibonacci numbers from F_0 to F_n modulo 1,000,000,007.

Medium5MathMatrixDivide and conquerNo attempts yetTime limit1sMemory limit256 MB

Problem

The Fibonacci numbers start with 0 and 1. The 0th Fibonacci number is 0 and the 1st Fibonacci number is 1. From index 2 on, each Fibonacci number is the sum of the two before it.

As a formula, Fn=Fn1+Fn2F_n = F_{n-1} + F_{n-2} for n2n \ge 2.

Written out up to n=17n = 17, the Fibonacci numbers are as follows.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597

Given nn, write a program that computes the sum of the Fibonacci numbers with an odd index, taken from the 0th through the nnth. That is the value of F1+F3+F5+F_1 + F_3 + F_5 + \cdots restricted to the terms whose index is at most nn.

Input

The first line contains nn. nn is a natural number less than or equal to 1,000,000,000,000,000,000.

Output

Print on the first line the sum of the Fibonacci numbers with an odd index, taken from the 0th through the nnth, modulo 1,000,000,007.