package main

import (
	"fmt"
	"math"
)

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

	a := make([]int, m)
	b := make([]int, m+1)
	max := 0
	for i:=0; i<m; i++ {
		fmt.Scan(&a[i])
		max = int(math.Max(float64(max), float64(a[i])))
		if i == 0 {
			b[i] = a[i]
		} else {
			b[i] = a[i] - a[i-1]
			if b[i] == 1 {
				fmt.Println(0)
				return
			}
		}
	}
	b[m] = n - a[m-1]
	fibonacci := make([]int, max)
	fibonacci[0], fibonacci[1] = 1, 1
	for i:=2;i<max;i++ {
		fibonacci[i] = fibonacci[i-1] + fibonacci[i-2]
	}
	ans := 1
	for i:=0;i<=m;i++ {
		ans = (fibonacci[b[i]-1]) * (ans) % 1000000007
		//fmt.Println(b[i], fibonacci[b[i]-1], ans)
	}
	fmt.Println(ans)
}