N, M = map(int, input().split())
A = list([int(input()) for i in range(M)])

stairs = [1] * (N+1)
for i in reversed(range(N+1)):
    if i in A:
        stairs[i] = 0
        continue

    prev_step, two_prev_step = 1, 0
    if (N + 1) > i+1:
        prev_step = stairs[i+1]
    if (N + 1) > i+2:
        two_prev_step = stairs[i+2]

    stairs[i] = prev_step + two_prev_step
print(stairs[0] % 1000000007)