import numpy as np
NM = input()
N, M = NM.split(" ")
del NM
N, M = int(N), int(M)
broken_steps = [int(input()) for num in range(M)]
#all_steps = [num for num in range(N+1)]
all_steps = np.ones(N+1, dtype=int)  ##np.int32だと足りない
all_steps[broken_steps] = 0
ok_steps = list(all_steps)
#ok_steps = [0 if num in broken_steps else 1 for num in range(len(all_steps))]
#for num in range(len(all_steps)):
#  if num in broken_steps:
#    ok_steps.append(0)
#  else:
#  	ok_steps.append(1)
#del all_steps, broken_steps
#print(ok_steps)
for num in range(0, len(ok_steps)):
  i = - (num + 1)
  
  if (i==-1 or i==-2):
    pass
  else:
    if ok_steps[i]==0:
      pass
    else:
      ok_steps[i] = ok_steps[i+1] + ok_steps[i+2]
      

#for num in range(0, len(ok_steps)):
#  i = - (num + 1)
#  
#  if (i==-1 or i==-2):
#    pass
#  else:
#    if ok_steps[i]==0:
#      pass
#    else:
#      print(i)
#      ok_steps[i] = ok_steps[i+1] + ok_steps[i+2]
#print(ok_steps[-3])        
print(ok_steps[0]%1000000007)