def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if A[1]:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if A[s] == 0:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1]) % 1000000007
    print(answer[N])

N, M = [int(x) for x in input().strip().split()]
A = [1] * N
for _ in range(M):
    A[int(input())] = 0
solve(N, M, A)

