package main

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

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 main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	m := nextInt()
	var ary = make([]int, n+1)
	for i := 0; i < m; i++ {
		broken := nextInt()
		ary[broken] = -1
	}

	ary[0] = 1
	if ary[1] == -1 {
		ary[1] = 0
	} else {
		ary[1] = 1
	}

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