#include VI c(VI a,VI b){return atcoder::convolution<>(a,b);}VI e(){return{1};}{ll@n,@q,a;atcoder::segtrees(n);rep(i,n)rd(a),s.set(i,{~-a%998244353,1});rep(q)rd(a),wt(s.prod(0,n)[a]);}