package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

var scanner *bufio.Scanner

func nextInt() int {
	scanner.Scan()

	var i, _ = strconv.Atoi(scanner.Text())

	return i
}

func nextString() string {
	scanner.Scan()

	return scanner.Text()
}

func initScanner() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
}

// math functuon
func maxInt(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}
func minInt(a, b int) int {
	return int(math.Min(float64(a), float64(b)))
}

// 階乗
func factorial(n int) int {
	if n < 1 {
		return 1
	}

	return n * factorial(n-1)
}

// 順列
func permutation(n, k int) int {
	return factorial(n) / factorial(n-k)
}

// 組み合わせ
func combination(n, k int) int {
	if k == 0 || k == n {
		return 1
	}

	return permutation(n, k) / factorial(k)
}

func main() {
	initScanner()

	var n = nextInt()
	var m = nextInt()

	var stops = make([]int, m)
	for i := 0; i < m; i++ {
		stops[i] = nextInt()
	}

	sort.Ints(stops)

	if stops[0] != 1 {
		stops = append([]int{0}, stops...)
	}

	stops = append(stops, n+1)

	var result = 1
	for i := 1; i < len(stops); i++ {
		var diff = stops[i] - stops[i-1] - 2

		if diff < 1 {
			result = 0
			break
		}

		result *= patternCount(diff)
		result %= 1000000007
	}
	fmt.Println(result)

}

func patternCount(n int) int {
	if n == 1 {
		return 1
	}

	// i は一段登る回数
	// j は二段登る回数
	var i, j = n, 0

	var sum = 0
	for {
		if i < 0 {
			break
		}

		sum += combination(i+j, i)

		i--
		i--
		j++
	}

	return sum
}
