package main

import (
	"fmt"
)

func main()  {
	var n, m int
	fmt.Scan(&n, &m)

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