package main

import (
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	brokenStairs := ScanNums(m)

	brokenStairsCount := len(brokenStairs)
	lastStair := brokenStairs[0]
	for i := 1; i < brokenStairsCount; i++ {
		if lastStair+1 == brokenStairs[i] {
			fmt.Println(0)
			return
		}
	}

	dp := make([]int, n+1)
	dp[0] = 1
	for i := 1; i <= n; i++ {
		if len(brokenStairs) > 0 && i == brokenStairs[0] {
			fmt.Println(brokenStairs[0])
			brokenStairs = brokenStairs[1:]
			dp[i] = 0
		} else {
			dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
		}
	}
	fmt.Println(dp[n])
}

func ScanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}

