n,m=map(int,input().split())
l=[]
for i in range(m):
  l.append(int(input()))
l1=[0 for i in range(n)]
if 1 in l:
  l1[0]=0
if 2 in l:
  l1[1]=0
elif 1 in l:
  l1[1]=1
else:
  l1[1]=2
for i in range(3,n+1): 
  if i in l:
    pass
  else:
    l1[i-1]=(l1[i-2]+l1[i-3])%((10**9+7))
print(l1[n-1])