#include #include using namespace atcoder; using namespace std; #define ll long long #define vl vector #define vvl vector using mint = modint998244353; auto _ = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); int main() { ll N, M; cin >> N >> M; mint ans = 0; for (ll i = 1; i <= N; i++) { for (ll j = 1; j <= M; j++) ans += (mint)i / std::gcd(i, j) * j; } cout << ans.val() << "\n"; return 0; }