N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if 1 == A[ind]:
        steps[1] = 0
        if ind < M-1:
            ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if i == A[ind]:
            steps[i] = 0
            if ind < M-1:
                ind += 1
    return steps[n] % 1000000007
print(step(N))