import math N, M = map(int, input().split()) S = 0 for n in range(1, N+1): for m in range(1, M+1): S += math.lcm(n, m) print(S % 998244353)