Odd Run

0

0 votes
maths, Combinatorics, Dynamic programming, Medium
Problem

Udit loves running . Today he is planning to run N meters and he has promised himself that he will take steps of odd meters only. He can take step of any size. Now , he wonders in how many ways he could run N meters by only taking odd metered steps. Order in which udit takes his step matters .

You have to print the answer mod 109+7

Input :

First line contains N

Output :

Output Number of distinct ways modulo 109+7

Constraints

1n105

Sample Input
4
Sample Output
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

To travel 4 metres, he may travel in following order:
1. 1 + 3
2. 3 + 1
3. 1 + 1 + 1 +1

So, there are 3 ways.

Editor Image

?