a,b=map(int,input().split()) s=0 import math for i in range(1, a+1): for j in range(1, b+1): s += i*j//math.gcd(i,j) print(s%998244353)