import math

n, m = [int(i) for i in input().split()]


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


a = [-1]
for mi in range(m):
    a.append(int(input()))
a.append(n+1)

ans = 1
for mi in range(1, m+2):
    if a[mi] == a[mi-1]:
        break
    elif a[mi] == a[mi-1] + 1:
        ans = 0
    k = a[mi] - a[mi-1] - 2
    max_2 = k//2
    cnt = 0
    for i in range(max_2+1):
        cnt += combi(k - i, i)
    ans = ans * cnt % 1000000007

print(ans)
