N, M = list(map(int, input().split()))
A = set(int(input()) for i in range(M))
x = [0] * (n+1)
x[0] = 1

for i in range(1, n+1): 
  if x[i] in A:
    x[i] = 0
  else:
    x[i] = (x[i-1] + x[i-2])%(10**9+7)
return x[n]