Sum of Squares of Fibonacci Numbers

Read n up to 1e18 and print the sum of squared Fibonacci numbers F_0 through F_n modulo 1,000,000,007.

Medium6MathMatrixDivide and conquerNo attempts yetTime limit1sMemory limit256 MB

Problem

The Fibonacci numbers start with 0 and 1. The 0th Fibonacci number is 0, the 1st is 1, and from the 2nd on each one 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 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597.

Given nn, write a program that adds up the squares of the Fibonacci numbers from the 0th through the nnth.

Input

The first line contains nn. It is a natural number between 1 and 1,000,000,000,000,000,000, inclusive.

Output

Print F02+F12++Fn2F_0^2 + F_1^2 + \cdots + F_n^2 modulo 1,000,000,007 on the first line.