N, M  = map(int, input().split())
a  = []
for _ in range(M):
  a.append(int(input()))
sdic  = {}
ans = 0
sdic[N] = 1
sdic[N+1] = 1
for n in reversed(range(N)[1:]):
  if n in a:
    continue
  if n+1 in sdic:
    ans += sdic[n+1]
  if not n+1 in sdic and not n+2 in sdic:
    print(0)
    quit()
  sdic[n] = ans
print(ans%1000000007)