The Fibonacci sequence is defined as:
Given nnn, compute Fnmod (109+7)F_n \mod (10^9 + 7)Fnmod(109+7).
nnn
Fnmod (109+7)F_n \mod (10^9 + 7)Fnmod(109+7)
0
For this input, the required output is 0.
1
For this input, the required output is 1.
10
For this input, the required output is 55.
55
1000
For this input, the required output is 517691607.
517691607