n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[1]=1
b[2]=2

for i in range(0,m):
  a.append(int(input()))
  
if 1 in a:
  b[1]=0
  if 2 in a:
    b[2]=0
  else:
    b[2]=1
  
for j in range(3,n+1):
  if j in a:
    continue
  else:
    b[j]=b[j-1]+b[j-2]
    
print(b[n]%(10**9+7))    
    
  
  
  

