n,m=map(int,input().split()) M=998244353 fa=[1,1] fb=[1,1] for i in range(2,2*10**6+1): fa+=[fa[-1]*i%M] fb+=[fb[-1]*(M//i)*fb[M%i]*fa[M%i-1]*(-1)%M] fc=lambda n,k:fa[n]*fb[k]*fb[n-k]%M if n>=k>=0 else 0 a=fa[m] for i in range(n): a*=fb[m//n] a%=M for i in range(m%n): a*=fa[m//n]*fb[m//n+1] a%=M print(a)