package main

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

const mod = 1000000007

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func include(a []int, n int) bool {
	for _, e := range a {
		if e == n {
			return true
		}
	}
	return false
}

func main() {
	sc.Split(bufio.ScanWords)
	N, M := nextInt(), nextInt()
	dp := make([]int, N+1)
	ma := make([]int, M)
	for i := 0; i < M; i++ {
		ma[i] = nextInt()
	}
	dp[0] = 1
	if !include(ma, 1) {
		dp[1] = 1
	}
	for i := 2; i < N+1; i++ {
		if !include(ma, i) {
			dp[i] = (dp[i-1] + dp[i-2]) % mod
		} else {
			dp[i] = 0
		}
	}
	fmt.Println(dp[N])
}
