N,M=map(int, input().split())
A=list(map(int, input().split()))
D={}
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
for a in A:
  AA=make_divisors(a)
  for b in AA:
    if b not in D:
      D[b]=0
    D[b]+=1
ans=[0]*M
mod=998244353 
for m in range(M,0,-1):
  if m not in D:
    continue
  d=D[m]
  p=(pow(2,d,mod)-1)%mod
  AA=make_divisors(m)[::-1]
  ans[AA[0]-1]+=p
  ans[AA[0]-1]%=mod
  for nex in AA[1:]:
    ans[nex-1]-=p 
    ans[nex-1]%=mod   
d=(pow(2,N,mod)-1-sum(ans[1:])%mod)%mod
ans[0]=d 
for i in ans:
  print(i)