N, M = map(int, input().split())
a = [int(input()) for i in range(M)]
div = 1000000007

A = [0]*(N+1)
A[0] = 1

for i in range(1, N+1):
  if i in a: A[i] = 0
  else:
    if i==1: A[i] = 1
    else:
      A[i] = (A[i-1] + A[i-2])%div

print(A[N])