# 組み合わせ
def ncr(n, r):
	return int(math.factorial(n) / (math.factorial(r) * math.factorial(n-r)))


n, m = map(int, input().split(' '))
# n, m = map(int, "100 5".split(' '))
# brokens = [int(input()) for _ in range(m)]
# brokens = [1, 23, 45, 67, 89]
brokens = [0 for _ in range(m)]
for i in range(m):
	brokens[i] = int(input())

steps = [0 for _ in range(m+1)]

# 移動する段数
steps[0] = brokens[0] - 1
for i in range(1, m):
	steps[i] = (brokens[i] - 1) - (brokens[i-1] + 1)
steps[m] = n - (brokens[m-1] + 1)

ans = 1
for i in range(m+1):
	stepComb = 1

	if(steps[i] < 0):
		ans = 0
		break
	
	twos = steps[i]//2

	for t in range(1, twos+1):
		stepComb += ncr((steps[i]-t), t)
	
	ans *= stepComb

print(ans % 1000000007)