package main

import (
	"fmt"
)

const MOD = 1000000007

func main() {
	var N, M, a int
	fmt.Scan(&N)
	fmt.Scan(&M)

	var as []int
	for i := 0; i < M; i++ {
		fmt.Scan(&a)
		as = append(as, a)
	}

	res := 1
	for i := 0; i < M; i++ {
		n := 0
		if i == 0 {
			n = as[i] - 1
		} else {
			n =  as[i] - as[i - 1] - 2
		}

		if n < 0 {
			fmt.Println(0)
			return
		}

		res *= fib(n) % MOD
		res = res % MOD
	}

	res *= fib(N - as[M - 1] - 1) % MOD
	res = res % MOD

	fmt.Println(res)
}

func fib(N int) int {
	if N < 2 {
		return 1
	}

	n1, n2, f := 1, 1, 1

	for i := 0; i < N - 1; i++ {
		f = n1 + n2
		n1 = n2
		n2 = f
	}

	return f
}