N, M = map(int, input().split())
a = [False] * (N+1)
for i in range(M):
    a[int(input())] = True

memo = [None] * (N+1)
memo[0] = 0 #0番目にたどり着く方法は0通りと定義する。
memo[1] = 1 if not a[1] else 0
if a[2] != True:
  if memo[1] == 0:
    memo[2] = 1
  else:
    memo[2] = 2
else:
  memo[2] = 0

for i in range(3, N+1):
    memo[i] = memo[i-1] + memo[i-2] if not a[i] else 0

print(memo[N] % 1000000007)