def touri(k1):
    if k1==-1:return 0
    an0=0
    k2=0
    while k1>=0:
        an1=1
        for i in range(k2):
            an1=an1*(k1+k2-i)/(i+1)
        an0+=an1
        k1-=2
        k2+=1
    return an0
n,m=map(int,input().split())
l=[int(input()) for _ in range(m)]
l2=[l[0]-1,n-l[-1]-1]
ans=1
for i in range(m-1):
    l2.append(l[i+1]-l[i]-2)
for j in l2:
    print(j)
    print(touri(j))
    ans*=touri(j)
print(int(ans%1000000007))


