p = 998244353 def pow(x,m): if m==0: return 1 if m==1: return x if m%2==0: return (pow(x,m//2)**2)%p else: return (x*(pow(x,(m-1)//2)**2)%p)%p A = [1 for _ in range(2*10**6+1)] for i in range(2,2*10**6+1): A[i] = (A[i-1]*i)%p B = [1 for _ in range(2*10**6+1)] B[2*10**6] = pow(A[2*10**6],p-2) for i in range(2*10**6-1,1,-1): B[i] = (B[i+1]*(i+1))%p def f(n,k): if k>n or k<0: return 0 if k==n or k==0: return 1 return (A[n]*B[k]*B[n-k])%p N,M = map(int,input().split()) if N>M or N==1: print(1) else: m = M//N k = M%N cnt = 0 for i in range(m+1): cnt = (cnt+f((m-i)*N+k+i,i))%p print(cnt)