#include using namespace std; #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") typedef long long ll; typedef pair prl; typedef vector vcl; typedef map mapl; typedef unordered_map umap; #define pb push_back #define all(v) v.begin(), v.end() #define rep(i,a,b) for(ll i=a;i<=b;i++) #define repi(i,a,b) for(int i=a;i<=b;i++) #define repr(i,a,b) for(ll i=a;i>=b;i--) #define reps(i,v) for(ll i=0;i void chmin(T &a, const T &b) { a = min(a, b); } template void chmax(T &a, const T &b) { a = max(a, b); } const ll mod = 998244353; int main() { // your code goes here ll n,m,dp[10000005]={0}; cin >> n >> m; if(n==1){ cout << m << endl; return 0; } dp[0]=1; rep(i,1,m){ if(i>=n) dp[i]=(dp[i]+dp[i-n])%mod; dp[i]=(dp[i]+dp[i-1])%mod; } cout << dp[m] << endl; return 0; }