n,m=map(int,input().split())

s=[0]*n

for _ in range(m):
  s[int(input())-1]=""
  
#print(s)

if n==1:
  print(1)
  exit()
elif n==2:
  if s[0]=="":
    print(1)
  else:
    print(2)
  exit()
  
if s[0]=="":
  s[0]=0
  s[1]=1
elif s[1]=="":
  s[0]=1
  s[1]=0
else:
  s[0]=1
  s[1]=2

i=2
while i<n:
  if s[i]=="":
    s[i]=0
  else:
    s[i]=s[i-1]+s[i-2]
  i+=1
print(s[-1]%1000000007)