eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci sum

Fibonacci sum

Let f(n) be the n-th Fibonacci number, given by

f(1) = 0, 
f(2) = 1, 
f(n) = f(n-2) + f(n-1), n > 2

Given the value of n, find f(1) + f(2) + ... + f(n).

Input

One positive integer n (n1000).

Output

Print the value of sum modulo 109 + 7.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5
Output example #1
7
Author Michael Medvediev