n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=int(input())
b=0
for i in range(1,n+1):
  if i==a:
    b+=1
    if b<m:a=int(input())
  else:
    dp[i]=dp[i-1]
    if i>1:dp[i]+=dp[i-2]
  dp[i]%=(10**9+7)
print(dp[-1])