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

x = [0]*(N+1)
y = [1]*(N+1)
for i in range(N+1):
    if i in a:
        y[i] = 0
x[0] = 1
if y[1] == 0:
    x[1] = 0
else:
    x[1] = 1

for i in range(2, N+1):
    if y[i] == 0:
        x[i] = 0
    else:
        x[i] = (x[i-1] + x[i-2]) % 1000000007
print(x[N])