package main

import "fmt"

func calc(N int, am map[int]struct{}) int64 {
	dp := make([]int64, N+1)

	for i := 0; i <= N; i++ {
		if i == 0 {
			continue
		}
		if i == 1 {
			dp[i] = 1
			continue
		}
		if i == 2 {
			dp[i] = 2
			continue
		}

		if i > 1 {
			if dp[i-1] == 0 && dp[i-2] == 0 {
				break
			}
		}

		if _, ok := am[i]; ok {
			dp[i] = 0
			continue
		}

		if dp[i-1] == 0 {
			dp[i] += dp[i-2]
		} else if dp[i-2] == 0 {
			dp[i] += dp[i-1]
		} else {
			dp[i] += dp[i-1] * 2
		}
	}

	return dp[N]
}

func main() {
	var N, M int
	fmt.Scanf("%d %d", &N, &M)
	am := map[int]struct{}{}
	for i := 1; i <= M; i++ {
		var a int
		fmt.Scan(&a)
		am[a] = struct{}{}
	}

	ans := calc(N, am)
	fmt.Println(ans % 1000000007)
}
