N,M = map(int,input().split())
mod=10**9+7
A=[1]*(N+1)
for i in range(M):
  a=int(input())
  A[a]=0
print(A)
for i in range(2,N+1):
  if A[i]!=0:
    A[i]=(A[i-1]+A[i-2])%mod
print(A[-1]%mod)
print(A)