n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1

for i in range(m):
  dp[int(input())]=-1

if dp[1]!=-1:
  dp[1]==1

for i in range(2,len(dp)):
  if dp[i]==-1:
    continue
  else:
    dp[i]=(max(dp[i-2],0)+max(dp[i-1],0))%1000000007
    if dp[i]==0:
      print(0)
      break
else:  
  print(dp[-1])
