N, M = map(int, input().split())
a = []
for i in range(M):
  a.append(int(input()))
dp = []
if a:
  cantuse = a.pop(0)
dp.append(1)
if cantuse == 1:
  dp.append(0)
  cantuse = a.pop(0)
else:
  dp.append(1)

for i in range(N-1):
  if (i+2) == cantuse:
    dp.append(0)
    if a:
      cantuse = a.pop(0)
  else:
    dp.append(dp[-1]+dp[-2])
print(dp[-1]%1000000007)