N, M = map(int, input().split())
x = [1] + [0] * N
mod = 10**9 + 7

if M > 0:
  A = []
  for i in range(M):
    A.append(int(input()))

  A.sort()
  ida = 0
  a = A[ida]
  if a == 1:
    ida += 1
    if M >= 2:
      a = A[ida]
  else:
    x[1] = 1

  for i in range(2, N+1):
    if i == a:
      ida += 1
      if ida >= M:
        a = N+1
      else:
        a = A[ida]

      x[i] = 0
    else:
      x[i] = (x[i-1] + x[i-2]) % mod
else:
  for i in range(2, N+1):
    x[i] = (x[i-1] + x[i-2]) % mod

print(x[N])
