n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

r = [1, 2]
if 1 in a:
  r[0] = 0
  if not 2 in a:
    r[1] = 1
if 2 in a:
  r[1] = 0

for i in range(2, n):
  # print(r)
  r.append(r[-2] + r[-1] if not (i+1) in a else 0)

print(r[-1] % 1000000007)
