#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define TIME (clock() * 1.0 / CLOCKS_PER_SEC)

const int M = 1e7 + 239;
const int X = 2e5 + 239;
const int L = 20;
const int MOD = 998244353;

int mul(int a, int b) {
    return 1LL * a * b % MOD;
}

int sum(int a, int b) {
    a += b - MOD;
    a += (a >> 31) & MOD;
    return a;
}

int power(int a, int k) {
    int ans = 1;
    int pw = a;
    while (k) {
        if (k & 1) {
            ans = mul(ans, pw);
        }
        pw = mul(pw, pw);
        k >>= 1;
    }
    return ans;
}

bool is_prime[M];
int cnt[2][M];
int primes[X], cnt_primes;

int main() {
#ifdef ONPC
    freopen("input", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, c;
    cin >> n >> c;
    for (int i = 2; i <= c; i++) {
        is_prime[i] = true;
    }
    for (int i = 2; i <= c; i++) {
        if (is_prime[i]) {
            for (int j = 2 * i; j <= c; j += i) {
                is_prime[j] = false;
            }
        }
    }
    cnt_primes = 0;
    for (int i = 2; i <= c; i++) {
        if (is_prime[i]) {
            primes[cnt_primes++] = i;
        }
    }

    for (int i = 1; i <= c; i++) {
        cnt[0][i] = 1;
    }
    int k_bound = min(n - 1, L);
    int ans = 0;
    int c_val = 1;
    for (int k = 0; k <= k_bound; k++) {
        // recalc the answer
        ll s = 0;
        for (int i = 1; i <= c; i++) {
            s += cnt[k & 1][i];
        }
        ans = sum(ans, mul(s % MOD, c_val));

        if (k == k_bound) {
            break;
        }

        // update
        c_val = mul(c_val, power(k + 1, MOD - 2));
        c_val = mul(c_val, n - 1 - k);
        for (int i = 1; i <= c; i++) {
            cnt[(k + 1) & 1][i] = cnt[k & 1][i];
        }
        for (int idx = 0; idx < cnt_primes; idx++) {
            int p = primes[idx];
            for (int i = 1, j = p; j <= c; i++, j += p) {
                cnt[(k + 1) & 1][j] += cnt[(k + 1) & 1][i];
            }
        }
        for (int i = 1; i <= c; i++) {
            cnt[(k + 1) & 1][i] -= cnt[k & 1][i];
        }
    }
    cout << ans << "\n";

    //cerr << TIME << "\n";
    return 0;
}
