package main

import "fmt"

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

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([]uint64, N+1)
	fmt.Println(dfs(0))
}

func dfs(n int) uint64 {
	if N < n || a[n] == 1 {
		return 0
	}
	if memo[n] != 0 {
		return memo[n]
	}
	if n == N {
		return 1
	}

	memo[n] = dfs(n+1) % mod
	memo[n] += dfs(n+2) % mod

	return memo[n]
}
