import sys
INF = (10 ** 9) + 5
N, M = map(int, input().split())
aLst = [0] * M

for i in range(M):
    aLst[i] = int(input())
ansLst = [0] * N
ans = 0
cnt = 0
for i in range(N):
    if i == 0:
        if aLst.count(1) == 0:
            ansLst[0] = 1
    elif i == 1:
        if aLst.count(2) == 0:
            ansLst[1] = 1 + ansLst[0]
    elif aLst.count(i + 1) != 1:
        ansLst[i] = (ansLst[i - 2] + ansLst[i - 1]) % INF
    else:
        cnt += 1
    if cnt == 2:
        print(0)
        sys.exit()
    cnt = 0

print(ansLst[-1])