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

DENOMINATOR = 1000000007

pos = 0
route = 1
before = 0

for i in range(1, N+1):
    route, before = route+before, route
    if A[pos] == i:
        route = 0
        if pos < M-1:
            pos+=1

print(route%DENOMINATOR)