N, M = map(int, input().split())

mod = 1000000007

A = []
for i in range(M):
    A.append(int(input()))
    
X = [0]*(N+2)

for i in range(2, N+2):
    if X[i] not in A:
        X[i] = min(X[i-1], X[i-2]) + 1

print(X[N+1]%mod)