# PROBLEM LINK:

* Author:* Manas Rawat

*Aagam Jain*

**Tester:***Manas Rawat*

**Editorialist:**# DIFFICULTY:

EASY - MEDIUM

# PROBLEM:

If we look closely at the question statement then the number of ways to reach a step depends on the number of ways to reach the previous two steps. So this forms a fibonacci series. We just have to find the Nth fibonacci number in this question.

# QUICK EXPLANATION:

Finding the Nth Fibonacci Number is easy but the contraints in this question does not allow us to do so easily. We can use our knowledge on Recurrence Relation and Matrix Exponentiation to find out the answer in log(N) time. If you donâ€™t know about Recurrence Relation then you can watch this video by CodeNCode where he has eplained the same.

# SOLUTIONS:

Solution can be found here.