Ways to Climb with Broken Steps

JavaScript Hard 3 views
Back to Questions

Problem Description

You have n steps. You can climb 1 or 2 steps. Some steps are broken (cannot land). Count number of ways to reach step n mod 1000000007.

Input Format

Line1: n m. Line2: m broken step numbers.

Output Format

One integer ways mod.

Sample Test Case

Input:
7 2 3 6
Output:
2

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next