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
if n==1:
  print(1)
elif n==2:
  if 1 in l:
    print(1)
  else:
    print(2)
else:
  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])