package main

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

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func getFloat() float64 {
	sc.Scan()
	n, _ := strconv.ParseFloat(sc.Text(), 64)
	return n
}

func sum(n []int) int {
	a := 0
	for _, v := range n {
		a += v
	}
	return a
}

func partseFloat(s string) (n float64) {
	n, _ = strconv.ParseFloat(s, 64)
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n, m := getInt(), getInt()

	a := make([]int, m)

	for i := 0; i < m; i++ {
		a[i] = getInt()
	}
	sort.Ints(a)

	x := make([]bool, n+1)

	j := 0
	for i := 0; i <= n; i++ {
		if i == a[j] {
			x[i] = false
			if j < m-1 {
				j++
			}
		} else {
			x[i] = true
		}
	}

	dp := make([]int64, n+1)
	dp[0] = 1
	if a[0] == 1 {
		dp[1] = 0
	} else {
		dp[1] = 1
	}

	for i := 2; i <= n; i++ {
		if x[i] {
			dp[i] = dp[i-1] + dp[i-2]
			dp[i] %= 1000000007
		} else {
			dp[i] = 0
		}
	}
	fmt.Println(dp[n])
}
