# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import defaultdict as dd S = input R = range P = print def I(): return int(S()) def M(): return map(int, S().split()) def L(): return list(M()) def O(): return list(map(int, open(0).read().split())) def yn(b): print("Yes" if b else "No") biga = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" smaa = "abcdefghijklmnopqrstuvwxyz" def acc(a): b = [0] for i in a: b.append(b[-1] + i) return b class Comb: def __init__(self, N, mod = 1000000007): self.n = N self.mod = mod self.fac = [0] * (self.n + 1) self.invf = [0] * (self.n + 1) self.inv = [0] * (self.n + 1) self.fac[0] = 1 self.fac[1] = 1 self.invf[0] = 1 self.invf[1] = 1 self.inv[1] = 1 for i in range(2, self.n + 1): self.fac[i] = self.fac[i - 1] * i % self.mod self.inv[i] = self.mod - self.inv[self.mod % i] * (self.mod // i) % self.mod self.invf[i] = self.invf[i - 1] * self.inv[i] % self.mod def F(self, N): return self.fac[N] def C(self, N, K): return self.invf[K] * self.invf[N - K] % self.mod * self.fac[N] % self.mod def P(self, N, K): return self.invf[N - K] * self.fac[N] % self.mod def H(self, N, K): return self.invf[K] * self.invf[N - 1] % self.mod * self.fac[N + K - 1] % self.mod N, K = M() c = Comb(1000001, 998244353) ans = 0 for i in range(N // K + 1): ans += c.C(N - K * i + i, i) print(ans % 998244353)