N,m = map(int,input().split())
A = list(int(input()) for i in range(m))
A.append(N+1)
def Fibonacci(n):
    a=[1,1]
    if n <= 1:
        return a[n]
    else:#nが2以上
        for i in range(2,n+1):
            a.append(a[i-1]+a[i-2])
        return a[n]

for i in range(0,m):
    if A[i+1] == A[i] + 1:
        print(0)
        exit()
All = Fibonacci(A[0]-1)
for i in range(m):
    All *= Fibonacci( (A[i+1] - 1) - (A[i] + 1) )
    print(All)
print(All%1000000007)
