n,m = map(int,input().split())
li = [int(input()) for _ in range(m)]
mod = 10**9+7

dp = [1]
t = 0
if 1==li[t]:
    t += 1
    dp += [0]
else:
    dp += [1]
for i in range(2,n+1):
    if i == li[t]:
        dp = [dp[1],0]
        if t<m-1:t += 1
        continue
    dp = [dp[1]%mod,(dp[0]+dp[1])%mod]
print(dp[1])