package main

import "fmt"

func main() {
	var N, M int
	fmt.Scan(&N, &M)

	var a int
	broken := make(map[int]bool)
	for i := 0; i < M; i++ {
		fmt.Scan(&a)
		broken[a] = true
	}

	dp := make([]int, N+2)
	dp[N] = 1
	for i := N - 1; i >= 0; i-- {
		if broken[i] {
			dp[i] = 0
		} else {
			dp[i] = dp[i+1] + dp[i+2]%1000000007
		}
	}
	fmt.Println(dp[0])
}
