n, m = map(int, input().split())
a = [-1]+[int(input()) for _ in range(m)]+[n+1]
b = []
ans, mod = 1, 10**9+7
for i in range(m+1):
    b.append(a[i+1]-a[i]-1)
print(b)
for i in range(m+1):
    diff = b[i]
    dp = [1, 1]
    if i != 0 and diff == 0:
        print(0)
        exit()
    for j in range(diff-2):
        dp.append(dp[j]+dp[j+1])
    ans *= dp[-1]
    ans %= mod
print(ans)