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

count = [0] * (N+1)
count[0] = 1
if 1 in A:
    if 2 in A:
        print(0)
        exit()
    count[1] = 1
    start = 2
else:
    count[1] = 1
    start = 1
for i in range(start, N+1):
    if i in A:
        continue
    count[i] = count[i-1] + count[i-2]
    count[i] %= 10**9 + 7

print(count[N])