from math import lcm MOD = 998244353 N, M = map(int, input().split()) print(sum(lcm(i, j) for i in range(1, N+1) for j in range(1, M+1))%MOD)