Recursion [I]
Recursion [I]
The Fibonacci Sequence is a famous sequence defined by the recurrence relation:
{F(n)=1F(n)=F(n−1)+F(n−2)0≤n≤1n≥2For example, F(0),F(1),F(2),F(3),F(4) can be written as 1,1,2,3,5
In this question, you must compute F(n) for some value n. Since the value may be quite large, output your answer modulo 109+7.
Input
Input will contain a single integer n
Output
Output should contain a single integer, representing F(n)mod109+7.
Constraints
- 0≤n≤1018
Example
5
8
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.