#include <bits/stdc++.h>
using namespace std;
#define int long long
void read (int &x) {
    char ch = getchar(); x = 0; int f = 0;
    while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar(); }
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
    if (f) x = -x;
} const int N = 2e5 + 5, mod = 998244353;
int qpow (int x, int y) {
    int t = 1;
    while (y) {
        if (y & 1) t = t * x % mod;
        x = x * x % mod, y >>= 1;
    }
    return t;
}
int n, m, res, a[N], t, p[N * 2], in[N * 2], b[N], tot, k[N];
int C (int x, int y) {
    return p[x] * in[y] % mod * in[x - y] % mod;
}
void prework () {
    p[0] = 1;
    for (int i = 1; i <= n + m; ++i) p[i] = p[i - 1] * i % mod;
    in[n + m] = qpow (p[n + m], mod - 2);
    for (int i = n + m; i >= 1; --i) in[i - 1] = in[i] * i % mod;

    for (int i = 2; i * i <= m; ++i)
        if (!k[i]) {
            b[++tot] = i;
            for (int j = i; j * j <= m; j += i) k[j] = 1;
        }
}
void work (int x) {
    t = 0;
    for (int i = 1; i <= tot && b[i] <= x; ++i) {
        int cnt = 0;
        while (x % b[i] == 0) ++cnt, x /= b[i];
        if (cnt) a[++t] = cnt;
    }
    if (x > 1) a[++t] = 1; int tmp = 1;
    for (int i = 1; i <= t; ++i) {
        tmp = tmp * C (a[i] + n - 1, a[i]) % mod;
    }
    // printf ("%lld %lld %lld\n", x, tmp, b[1]);
    (res += tmp) %= mod;
}
signed main() {
    read (n), read (m); prework ();
    // printf ("%d\n", tot);
    for (int i = 1; i <= m; ++i) work (i);
    printf ("%lld\n", res);
}

#include <bits/stdc++.h>
using namespace std;

const int N = 2e5 + 10, mod = 998244353;

int n, fa[N], ans = 1;

int find_(int x) {
	return x == fa[x] ? x : fa[x] = find_(fa[x]);
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		fa[i] = i;
	for (int i = 1, x; i <= n; i++) {
		scanf("%d", &x);
		if (find_(x) == find_(i)) 
			ans = ans*2%mod; 
		else	
			fa[find_(i)] = find_(x);
	}
	printf("%d\n", (ans + mod - 1)%mod);
}