import numpy as np N,M = map(int,input().split()) MOD = 998244353 if N > M or N == 1: print(1) exit(0) dp = np.zeros((M + 1), dtype='i') dp[0] = 1 for i in range(M): j = i + N if j <= M: dp[j] += dp[i] dp[j] %= MOD dp[i + 1] += dp[i] dp[i + 1] %= MOD print(dp[-1])