N, M = map(int, input().split())
booleans = [True for _ in range(N+1)]
counts = [0 for _ in range(N+1)]
for _ in range(M):
    booleans[int(input())] = False

for n in range(N-1):
    if not booleans[n] and not booleans[n+1]:
        print(0)
        exit()

if booleans[1]:
    counts[1] = 1
if booleans[2]:
    counts[2] = 1 + counts[1]

for n in range(2, N):
    if not booleans[n-1] and booleans[n]:
        counts[n+1] = counts[n]
    elif not booleans[n] and booleans[n-1]:
        counts[n+1] = counts[n-1]
    else:
        counts[n+1] = (counts[n] + counts[n-1]) % 1000000007

print(counts[N])