package main

import (
	"bufio"
	"fmt"
	"os"
	"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(map[int]int, m)

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

	var x []int
	x = append(x, 1)
	if a[1] == 1 {
		x = append(x, 0)
	} else {
		x = append(x, 1)
	}

	for i := 2; i <= n; i++ {
		a[i]++
		if a[i] == 1 {
			x = append(x, x[i-1]+x[i-2])
		} else {
			x = append(x, 0)
		}
	}

	fmt.Println(x[len(x)-1] % 1000000007)
}
