import sys
import math
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

def c_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def get_count(num):
	count = 0
	for i in range(num // 2 + 1):
		count += c_count(num - i, i)
	return count % 1000000007

if M >= 1:
	num = a[0]
	ans = get_count(num - 1)
	
	if M > 1:
		for i in range(1, M):
			if a[i] == a[i-1] + 1:
				print(0)
				sys.exit()
			ans *= get_count(a[i] - a[i-1] - 2)
	ans *= get_count(N - a[-1] - 1)
	print(ans % 1000000007)
else:
	print(get_count(N))