P=10**9+7 n,m=map(int,input().split()) for i in range(m):q,r=divmod(n+1,i+1);print(pow(q+1,r,P)*pow(q,i-r,P)*(q-1)%P)