#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 2000000005

int main(){
	
	int N,M;
	cin>>N>>M;
	
	vector<int> dp(M+1,0);
	dp[0] = 1;
	
	for(int i=0;i<M;i++){
		dp[i+1] = mod(dp[i+1] + dp[i]);
		if(N!=1&&i+N<=M){
			dp[i+N] = mod(dp[i+N] + dp[i]);
		}
	}
	
	cout<<dp.back()<<endl;
	
	return 0;
}