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

is_broken=[True]*(n+1)
for i in range(m):
  is_broken[broken[i]]=False
   
dp=[0]*(n+1)

if  is_broken[1]:
  dp[1],dp[2]=1,2
else:
  if is_broken[2]:
    dp[2]=1

if n>=2:
  for i in range(3,n+1):
    if i in broken:
      dp[i]=0
    
    elif  is_broken[i-1] and is_broken[i-2]:
      dp[i]=dp[i-1]+dp[i-2]
      dp[i]%=mod
    
    elif is_broken[i-1]:
      dp[i]=dp[i-1]
      dp[i]%=mod
    
    elif is_broken[i-2]:
      dp[i]=dp[i-2]
      dp[i]%=mod
    
    else:
      dp[i]=0
print(dp[n])
