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