import math
n, m = map(int, input().split())
a = [-1] + [int(input()) for i in range(m)] + [n+1]
func = math.factorial
count = 1
for i in range(m+1):
    k = a[i+1] - a[i] - 2
    if k == -1:
        count = 0
        break
    else:
        work = 0
        for b in range(k//2+1):
            work += func(k-b)//(func(k-2*b)*func(b))
        count *= work
print(count%1000000007)