N, M = map(int, input().split())
A = [0] * M

for i in range(M):
    A[i] = int(input())

A = set(A)
root = [0] * (N+1)  # N danme madeno root
root[0] = 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()

if 1 in A:
    root[1] = 0
else:
    root[1] = 1

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

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

print(root[N] % 1000000007)