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

dp_l = [1, 1]+[-1]*(n-1)

def dp(n):
  if n in A:
    dp_l[n] = 0
  
  if dp_l[n] == -1:
    dp_l[n] = (dp(n-1)+dp(n-2))%mod
  
  return(dp_l[n])

print(dp(n))