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

for i in range(M):
    aLst[i] = int(input())
ansLst = [0] * (N + 1)
ans = 0
ansLst[0] = 1
for i in range(1, N + 1):
    if aLst.count(i) == 1:
        continue
    tmp = ansLst[i - 1]
    if i > 1:
        tmp += ansLst[i - 2]
    ansLst[i] = tmp % INF


print(ansLst[N])
