N, M = map(int, input().split())

if M == 0:
    A = [-1]
else:
    A = [-1] * M
    for i in range(M):
        A[i] = int(input())
A = set(A)

root = [0] * (N+1)  # N danme madeno root
root[0] = 1  # start is 1

if N == 1:
    if 1 in A:
        print(0)
    else:
        print(1)
    exit()

if N == 2:
    if 1 in A and 2 in A:
        print(0)
    else:
        if 1 in A:
            print(1)
        else:
            print(0)
    exit()

root[1] = 0 if 1 in A else 1
root[2] = 0 if 2 in A else (root[0] + root[1])

for i in range(3, N+1):
    root[i] = 0 if i in A else (root[i-1] + root[i-2])

print(root[N] % 1000000007)