package main

import "fmt"

func dedup(ns []int) []int {
	ret := make([]int, 0)
	prev := -1
	for _, n := range ns {
		if prev != n {
			prev = n
			ret = append(ret, n)
		}
	}
	return ret
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	xs := make([]int, m)
	for i := range xs {
		fmt.Scan(&xs[i])
	}
	xs = dedup(xs)

	memo := make([]int, n+1)
	memo[0] = 1
	j := 0
	if xs[0] == 1 {
		memo[1] = 0
		j++
	} else {
		memo[1] = 1
	}

	for i := 2; i <= n; i++ {
		if j < len(xs) && i == xs[j] {
			memo[i] = 0
			j++
		} else {
			memo[i] = (memo[i-1] + memo[i-2]) % 1000000007
		}
	}

	fmt.Println(memo[n])
}
