	package main

	import "fmt"

	var mod int = 1000000007
	var N, M int
	var a []int
	var memo []int

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

		a = make([]int, N+1)
		for i := 0; i < M; i++ {
			var t int
			fmt.Scan(&t)
			a[t] = 1
		}
		memo = make([]int, N+1)
		fmt.Println(dfs(N))
	}

	func dfs(n int) int {
		if n < 0 || a[n] == 1 {
			return 0
		}
		if memo[n] != 0 {
			return memo[n]
		}
		if n == 0 {
			memo[0] = 1
			return memo[0]
		}
		var x, y int
		if 0 < n-1 && memo[n-1] != 0 {
			x = memo[n-1]
		} else {
			x = dfs(n - 1)
		}

		if 0 < n-2 && memo[n-2] != 0 {
			y = memo[n-2]
		} else {
			y = dfs(n - 2)
		}

		memo[n] = (x + y) % mod
		return memo[n]
	}
