#include<bits/stdc++.h>
#define pi 3.141592653589793238
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
 
#define mt make_tuple
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
 
 
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const int N = 5e3 + 1;
ll dp[80][N];
ll fac[N]; 
ll f[N][N];
ll power(ll x, ll y, ll p){
    ll res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll modi(ll a, ll m){
    return power(a, m - 2, m);
}
ll nCr(ll n, ll r, ll p){
    if (r == 0)
        return 1;
    if(f[n][r] != -1){
        return f[n][r];
    }
    return f[n][r] = (fac[n] * modi(fac[r], p) % p *
        modi(fac[n - r], p) % p) % p;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll T = 1, i, j;
    
    //cin >> T;
    while (T--) {
        memset(f, -1, sizeof(f));
        ll mod = 998244353;
        fac[0] = 1;
        for(i = 1; i < N; i++){
            fac[i] = (i * fac[i - 1]) % mod;
        }
        ll n, m;
        cin >> n >> m;
        ll ofset = 1;
        dp[0][0] = 1;
        for(i = -1; i < 14; i++){
            for(ll sum = 0; sum <= m; sum++){
                for(j = 0; j <= n; j += 2){
                    if(sum + (1 << (i + 1)) * j > m){
                        continue;
                    }
                    dp[i + 1 + ofset][sum + (1 << (i + 1)) * j] += dp[i + ofset][sum] * nCr(n, j, mod);
                    dp[i + 1 + ofset][sum + (1 << (i + 1)) * j] %= mod;
                }
            }
        }
        cout << dp[14][m] << endl;
    }
    return 0;
}
#include<bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
using namespace std;
inline int read(){
	int res=0;
	bool zf=0;
	char c;
	while(((c=getchar())<'0'||c>'9')&&c!='-');
	if(c=='-')zf=1;
	else res=c-'0';
	while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0';
	if(zf)return -res;
	return res;
}
const int maxn=2e5+5,P=998244353;
int f[maxn],g[maxn];
int p[maxn],r;
int v[maxn],inv[25];
signed main(){
	int n=read(),m=read(),ans=1;
	inv[1]=1;
	for(register int i=2;i<=20;++i){
		inv[i]=1ll*inv[P%i]*(P-P/i)%P;
	}
	for(register int i=2,t;i<=m;++i){
		if(!v[i]){
			f[i]=n,g[i]=1,p[++r]=i;
		}
		for(register int j=1;j<=r&&(t=i*p[j])<=m;++j){
			v[t]=1;
			if(i%p[j]){
				f[t]=1ll*f[i]*n%P,g[t]=1;
			}
			else{
				f[t]=1ll*f[i]*(n+g[i])%P*inv[g[i]+1]%P,g[t]=g[i]+1;
				break;
			}
		}
		ans+=f[i];
		(ans>=P)&&(ans-=P);
	}
	printf("%d\n",ans);
	return 0;
}