n, m = map(int,input().split())
a = [int(input()) for _ in range(m)]
dp = [0]*(n+2)
mod = int(1e9+7)
for i in range(n, -1, -1):
  if i==n and a[-1]!=i:
    dp[i] = 1
  elif i!=n:
    if i in a:
      dp[i] = 0
    else:
      dp[i] = dp[i+1] + dp[i+2]
  else:
    break

print(dp[0]%mod)
