Climbing the Staircase
You climb a staircase of N steps taking 1 or 2 steps at a time. How many distinct step sequences reach the top, modulo 109+7?
Input: one integer N.
Output: the number of ways mod 109+7.
Constraints:
- 1 ≤ N ≤ 106
Sample Tests
Input 1
4
Output 1
5
Input 2
1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.