from math import isqrt mod = 998244353 n,m = map(int, input().split()) k = isqrt(m) ans = 0 for i in range(1, min(n+1, k+1)): ans += (m % i) ans %= mod for d in range(0, m//k+1): r = n+1 if d == 0 else min(m // d + 1, n+1) l = max(m // (d+1) + 1, k+1) if r <= l: continue ans += m * (r-l) - (r-l) * (l+r-1) // 2 * d ans %= mod print(ans)