#an+2 = an+1 + an
n,m = map(int,input().split())
a=[]
for i in range(m):
  a.append(int(input()))
ans = [0]*n
for floor in range(1,n+1):
  if floor in a:
    ans[floor-1] = 0
  elif floor == 1:
    ans[0] = 1
  elif floor == 2:
    ans[1] = ans[0]+1
  else:
    ans[floor-1] = ans[floor-2] + ans[floor-3]
print(ans[n-1]%1000000007)
 