N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
B = [0] * (N + 1)
B[0] = 1
if 1 not in A:
    B[1] = 1
else:
    B[1] = 0

for i in range(2, N + 1):
    if i != 2 and i - 1 in A and i - 2 in A:
        print(0)
        exit()
    elif i - 2 in A:
        B[i] = B[i - 1]
    elif i - 1 in A:
        B[i] = B[i - 2]
    else:
        B[i] = B[i - 1] + B[i - 2]
mod = 10**9 + 7
print(B[N] % mod)
