N, M = map(int, input().split())
ana = [0] * M
ans = [0] * N
mod = 10 ** 9 + 7
if M != 0:
    for i in range(M):
      ans[int(input())-1] = -1

if ans[0] == -1:
    ans[0] = 0
    ans[1] = 1
elif ans[1] == -1:
    ans[0] = 1
    ans[1] = 0
else:
    ans[0] = 1
    ans[1] = 2

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