package main

import "fmt"

var memo = make([]int, 100005)

func main() {

	var N, M int
	fmt.Scan(&N, &M)
	a := make([]int, M)
	for i := 0; i < M; i++ {
		fmt.Scan(&a[i])
	}
	if M != 1 { //０の場合チェック
		for i := 0; i < M-1; i++ {
			if a[i+1]-a[i] == 1 {
				fmt.Println(0)
				return
			}
    }
	}
	// fmt.Println(a)

	result := 1
	for i := 0; i <= M; i++ {
		if i == 0 {
			result *= conb(a[0] - 1)
		} else if i == M {
			result *= conb(N - a[i-1] - 1)
		} else {
			result *= conb(a[i] - a[i-1] - 2)
		}
		// result *= conb(a[i]-a[i-1])
	}
	fmt.Println(result%1000000007)
}

func conb(d int) int { //d段まで何通りあるか　0スタート
	if memo[d] != 0 {
		return memo[d]
	} else if d == 2 {
		memo[d] = 2
		return memo[d]
	} else if d == 1 {
		memo[d] = 1
		return memo[d]
	} else if d == 0 {
		memo[d] = 1
		return memo[d]
	} else {
		memo[d] = conb(d-1) + conb(d-2)
		return memo[d]
	}
}
