from scipy.special import comb

N,M= map(int, input().split())
aList = [0] * M
for i in range(M):
    aList[i] = int(input())

aList.sort()
aList.append(N+1)

result = 1
MOD = 7+10**9
now = 0
for a in aList:
    if now == a:
        result = 0
        break

    x = (a - now - 1)
    root = 1
    for i in range(x//2, x):
        root += int(comb(x, (x-i+1), exact = False))
    result = result * root
    result = result % MOD
    now = a+1
print(result)