Question
Jump 1 2 or 3
A frog jumps either 1, 2, or 3 steps to go to the top. In how many ways can it reach the top of Nth step. As the answer will be large find the answer modulo 1000000007.
Input
You're given an integer N. (1 <= N <= 105).
Output
Print the number of ways.
Example
Input:
4
Output:
7
Explanation:
Below are the 7 ways to reach
4
1 step + 1 step + 1 step + 1 step
1 step + 2 step + 1 step
2 step + 1 step + 1 step
1 step + 1 step + 2 step
2 step + 2 step
3 step + 1 step
1 step + 3 step

Online