package main

import (
	"fmt"
)

func main() {
	var N, M int
	var MOD int = 1e9 + 7
	fmt.Scan(&N, &M)
	dp := make([]int, N+1)
	for i := 0; i < M; i++ {
		var a int
		fmt.Scan(&a)

		dp[a] = -1
	}

	dp[0] = 1

	if dp[1] != -1 {
		dp[1] = 1
	}

	for i := 2; i < N+1; i++ {
		var calc int

		if dp[i] == -1 {
			continue
		}

		if dp[i-1] != -1 {
			calc += dp[i-1] % MOD
		}

		if dp[i-2] != -1 {
			calc += dp[i-2] % MOD
		}

		dp[i] = calc
	}

	ans := dp[N]

	fmt.Println(ans)
}
