N, M = list(map(int, input().split()))
not_used = [int(input()) for i in range(M)]
mod_value = 1000000007
 

dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
  if i+1 not in not_used:
    dp[i+1] += dp[i]
    dp[i+1] %= mod_value
  
  if i+2 not in not_used and i+2 < N+1:
    dp[i+2] += dp[i]
    dp[i+2] %= mod_value

print(dp[-1])