// https://atcoder.jp/contests/abc129/tasks/abc129_c

package main

import "fmt"
import "bufio"
import "os"
import "strconv"

var _sw = bufio.NewScanner(os.Stdin)

const mod = 1000000007

func main() {
	N := NextInt()
	M := NextInt()
	broken := make([]bool, N+1)
	for i := 0; i < M; i++ {
		a := NextInt()
		broken[a] = true
	}

	// i 段目まで行く方法
	counts := make([]int, N+1)
	counts[0] = 1

	for i := 1; i < len(counts); i++ {
		if broken[i] {
			counts[i] = 0
			continue
		}

		if i == 1 {
			counts[i] = counts[i-1]
		} else {
			counts[i] = counts[i-1] + counts[i-2]
		}
	}

	fmt.Println(counts[N] % mod)
}

func init() {
	_sw.Split(bufio.ScanWords)
}

func NextInt() int {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	i, e := strconv.Atoi(_sw.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func NextString() string {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	return _sw.Text()
}

func Max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func Min(x, y int) int {
	if x > y {
		return y
	}
	return x
}
