n,m = map( int, input().split() )

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

m += 1
ans = 1
dp = []
for i in range(m):
    if a[i-1]-a[i]-1 == 0:
        ans = 0
        break
    elif a[i-1]-a[i]-1 == 1:
        continue
    else:
        dp.clear()
        dp = [1] + [0]*(a[i+1]-a[i]-2)
    for j in range(1, a[i+1]-a[i]-1):
        dp[j] = dp[j-1] + dp[j-2]
    ans *= dp[-1]

print(ans%1000000007)