Fibonacci sum#11251

Fibonacci sum

1 segundo
128 megabytes
Fácil

Let be the -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 , find f(1) + f(2) + ... + f(n).

Entrada

One positive integer (n \le 1000).

Salida

Print the value of sum modulo 10^9 + 7.

Ejemplos

Ejemplo 1

Loading
Loading