N,M=map(int,input().split())
ans=[0 for i in range(N)]
for i in range(M):
  a=int(input())
  ans[a-1]=-1
mod=10**9+7
if ans[0]==-1 and ans[1]==-1:
  print(0)
  exit()
if ans[0]!=-1 and ans[1]==-1:
  ans[0]=1
if ans[0]==-1 and ans[1]!=-1:
  ans[1]=1
else:
  ans[0]=1
  ans[1]=2
for i in range(N-2):
  if ans[i+2]==-1:
    pass
  else:
    if ans[i]==-1 and ans[i+1]==-1:
      print(0)
      exit()
    if ans[i]==-1 and ans[i+1]!=-1:
      ans[i+2]=ans[i+1]
    if ans[i]!=-1 and ans[i+1]==-1:
      ans[i+2]=ans[i]
    if ans[i]!=-1 and ans[i+1]!=-1:
      ans[i+2]=(ans[i+1]+ans[i])%mod
print(ans[N-1])
