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