Fibonacci sum
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 (n ≤ 1000).
Output
Print the value of sum modulo 10^9
+ 7.
Examples
Input #1
Answer #1
Submissions 485
Acceptance rate 24%