n, m = map(int, input().split())
a = [int(input()) for x in range(m)]
mod = 10**9 + 7

l = [0]*(n+1)
l[0] = 1

for i in range(1, n+1):
  if i in a:
    if l[i-1] == 0:
      print(0)
      exit()
  else:
    l[i] = (l[i-2] + l[i-1]) % mod

print(l[-1])
