N, M = map(int, input().split())
a = [int(input()) for i in range(M)]
n = [0] * N
n[0] = 1
n[1] = 2

if 1 in a and N == 1:
    print(0)
    exit()
if 1 in a and 2 in a:
    print(0)
if 1 in a:
    n[0] = 0
    n[1] = 1

for i in range(N - 2):
    if i + 3 not in a:
        n[i + 2] = (n[i + 1] + n[i]) % 1000000007

print(n[N - 1])