n,m=map(int,input().split())
ans=-1
dp=[0 for i in range(n+1)]
dp[1]=1
dp[2]=2


q=1000000007
a=[]
if n>=3:
  for i in range(m):
    b=int(input())
    a.append(b)
    if b==1:
      dp[1]=0
      dp[2]=1
    if b==2:
      dp[2]=0

  for i in range(m-1):
    if a[i+1]-a[i]==1:
      ans=0
      break

  for i in range(3,n+1):
    if i in a:
      continue
    else:
      dp[i]=(dp[i-1]%q+dp[i-2]%q)%q
      """print("dp[i]",i,dp[i])"""
  if ans==0:
    dp[n]=ans
print(dp[n])
