package main

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

const MOD = 1000000007

var SIntListInitialValue int
var SIntListIsInitialized bool

type SIntList []int

func lib_ContainsInt(values []int, v int) bool {
	for _, value := range values {
		if value == v {
			return true
		}
	}
	return false
}
func lib_ModSum(a, b, mod int) int {
	return ((a % mod) + (b % mod)) % mod
}
func lib_NewSIntList(length int, initialValue int) SIntList {
	if SIntListIsInitialized {
		panic("SIntList is already used")
	}
	ret := make([]int, length, length)
	for i := 0; i < length; i++ {
		ret[i] = initialValue
	}
	SIntListInitialValue = initialValue
	return ret
}
func lib_TernaryOPInt(ok bool, v1, v2 int) int {
	if ok {
		return v1
	}
	return v2
}
func main() {
	scanner := bufio.NewScanner(os.Stdin)
	const initialBufSize = 4096
	const maxBufSize = 1000000
	scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	scanner.Split(bufio.ScanWords)
	var N int
	scanner.Scan()
	N, _ = strconv.Atoi(scanner.Text())
	var M int
	scanner.Scan()
	M, _ = strconv.Atoi(scanner.Text())
	a := make([]int, M)
	for i := 0; i < M; i++ {
		scanner.Scan()
		a[i], _ = strconv.Atoi(scanner.Text())
	}
	fmt.Println(solve(N, M, a))
}
func solve(N int, M int, a []int) int {
	dp := lib_NewSIntList(N+1, 0)
	dp[1] = lib_TernaryOPInt(lib_ContainsInt(a, 1), 0, 1)
	dp[2] = lib_TernaryOPInt(lib_ContainsInt(a, 2), 0, dp[1]+1)
	for i := 3; i <= N; i++ {
		if lib_ContainsInt(a, i) {
			continue
		}
		dp[i] = lib_ModSum(dp[i-1], dp[i-2], MOD)
	}
	return dp[N]
}
