#include using namespace std; #define rep(i,n) for(int i=0;i=0;--i) #define debug(output) if(debugFlag)cout<<#output<<"= "< P; const bool debugFlag=true; const lint linf=1.1e18;const int inf=1.01e9; constexpr int MOD=1000000007; templatebool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; } #include using namespace atcoder; using mint = modint998244353; signed main(){ int n,k;cin>>n>>k; mint res=0; mint K=k; rep1(x,k){ mint X=x; mint sm=X.pow(n)-(X-1).pow(n); sm-=n*(X-1).pow(n-1); sm+=n*(K-X)*(X.pow(n-1)-(X-1).pow(n-1)); res+=sm*x; } cout<