from atcoder.lazysegtree import LazySegTree N, K = map(int, input().split()); N -= K mod = 998244353 def op(a, b): return (a+b)%mod def mapping(f, g): return (f+g)%mod def composition(f, g): return (f+g)%mod lst = LazySegTree(op, 0, mapping, composition, 0, [1]*(N+1)) for i in range(N): if i + K <= N: lst.apply(i+K, N+1, lst.get(i)) print(lst.all_prod()+1)