package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

// 一行読み出し
func nextLine() string {
	sc.Scan()
	return sc.Text()
}

// 文字列リバース関数
func strReverse(s string) string {
	rs := []rune(s)
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		rs[i], rs[j] = rs[j], rs[i]
	}
	return string(rs)
}

// スペース区切りの文字列から int のスライスを得る
func intSlice(s string) []int {
	ss := strings.Split(s, " ")
	res := make([]int, len(ss))
	for i, v := range ss {
		iv, _ := strconv.Atoi(v)
		res[i] = iv
	}

	return res
}

var limit int = 1000000007

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	broken := make([]bool, n+1)
	for i := 0; i < m; i++ {
		var a int
		fmt.Scan(&a)
		broken[a] = true
	}

	dp := make([]int, n+2)
	dp[n+1] = 0
	dp[n] = 1
	for i := n - 1; i >= 0; i-- {
		if broken[i] {
			dp[i] = 0
		} else {
			dp[i] = dp[i+1] + dp[i+2]
		}
	}

	fmt.Println(dp[0] % limit)
}
