import sys from collections import deque, Counter sys.setrecursionlimit(5 * 10 ** 5) from pypyjit import set_param set_param('max_unroll_recursion=-1') input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 import random n, m = mi() a = li() count = [0] * (m + 1) for v in a: count[v] += 1 gcount = [0] * (m + 1) for i in range(1, m + 1): for j in range(i, m + 1, i): gcount[i] += count[j] g = [0] * (m + 1) for i in range(1, m + 1): g[i] = pow(2, gcount[i], mod) - 1 g[i] %= mod for i in range(m, 0, -1): for j in range(2 * i, m + 1, i): g[i] -= g[j] g[i] %= mod for v in g[1:]: print(v)