N, M = map(int,input().split())
a = [int(input()) for _ in range(M)]
mod = pow(10,9) + 7

dp = [0]*(N+1)
dp[0] = 1

for i in range(N):
  for j in range(i+1,min(N+1,i+3)):
    if j not in a:
      dp[j] += dp[i]
      dp[j] %= mod
      
print(dp[N])