n,k = map(int,input().split()) mod = 998244353 ans = 0 for i in range(2,k+2): ans += pow(i,n,mod) ans %= mod print(ans)