Broken Steps
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In how many ways can you reach the Nth step if you can move to the next step, skip one step, or skip two steps, given that some steps are broken?
Input
The first line contains two integers: N, the step number you want to reach, and K, the number of broken steps. (1 ≤ K ≤ N ≤ 60).The second line lists the numbers of the broken steps.
Output
Output a single integer representing the number of ways to reach the Nth step, or -1 if it is impossible to reach that step.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 28%