n,m=map(int, input().split())
a=[]
for i in range(m):
  a.append(int(input()))

mod=1000000007

dp=[0]*(n+1)
dp[0]=1
dp[1]=1

for i in range(n-1):
  if not i+2 in a:
    if i in a and i+1 in a:
      dp[i+2]=0
    elif i in a:
      dp[i+2]=dp[i+1]
    elif i+1 in a:
      dp[i+2]=dp[i]
    else:
      dp[i+2]=dp[i+1]+dp[i]

  dp[i+2] = dp[i+2] % mod
  #print(dp)

print(dp[n])

