LearnPy Hub
← Arena
AdvancedRating 1600

Huge Fibonacci

Print F(n) mod 1 000 000 007, where F(0) = 0 and F(1) = 1. n can be up to 10¹⁸: use fast doubling or matrix power.

Input

One integer n.

Output

F(n) mod 10⁹+7.

Sample 1

Input
10
Output
55

Sample 2

Input
0
Output
0
solution.py
Output appears here
Huge Fibonacci · Python Arena problem · LearnPy Hub