def fib(n):
  if n==0:
    return 0
  elif n==1:
    return 1
  else:
    x=fib(n-1)+fib(n-2)
    return x

n,m=map(int, input().split())
a=[]
for i in range(m):
  b=int(input())
  a.append(b)
  
d=[]
if a[0]-1==0:
  d.append(1)
else:
  d.append(a[0]-1)
d.append(n-a[m-1])
for i in range(m-1):
  d.append(a[i+1]-a[i]-1)

ans=1

for i in range(m+1):
  ans=ans*fib(d[i])
  
  print(d[i])

print(ans%(10**9+7))