package main

import (
	"fmt"
)

func fact(n int) int {
	f := 1
	for i := 1; i <= n; i++ {
		f *= i
	}
	return f
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	aList := make([]int, 0, m+2)
	aList = append(aList, -1)
	for i := 0; i < m; i++ {
		var tmp int
		fmt.Scan(&tmp)
		aList = append(aList, tmp)
	}
	aList = append(aList, n+1)

	var ans int64 = 1
	cur := aList[0]
	for _, a := range aList[1:] {
		sub := a - cur - 2
		cur = a
		if sub <= 1 {
			if sub == -1 {
				fmt.Println(0)
				return
			}
			continue
		}
		count := 0
		for j := 0; j <= sub/2; j++ {
			count += fact(sub-j) / fact(j) / fact(sub-j*2)
		}
		ans *= int64(count)
	}
	fmt.Println(ans % 1000000007)
}
