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

Keiro = [0 for _ in range(N+1)]
Keiro[0] = 1
Keiro[1] = 1
for i in range(2,N+1):
    if i in a:
        continue
    else:
        Keiro[i] = (Keiro[i-1]+Keiro[i-2])%(1e9+7)

print(Keiro)
print(Keiro[-1])