# -*- coding: utf-8 -*- def cmb(n, r, p): if (r < 0) or (n < r): return 0 r = min(r, n - r) return fact[n] * factinv[r] * factinv[n-r] % p p = 998244353 N = 10 ** 6 # N は必要分だけ用意する fact = [1, 1] # fact[n] = (n! mod p) factinv = [1, 1] # factinv[n] = ((n!)^(-1) mod p) inv = [0, 1] # factinv 計算用 for i in range(2, N + 1): fact.append((fact[-1] * i) % p) inv.append((-inv[p % i] * (p // i)) % p) factinv.append((factinv[-1] * inv[-1]) % p) N, K = map(int, input().split()) K = N - K # number of 1 mod = 998244353 ans = 0 for i in range(K+1): if i%2 == 1: continue if N - i == 0: ans += 1 if N - i - 1 == 0: ans += i + 1 if N - i - 2 < 0: continue a = i + 1 b = cmb((N - i - 2), K - i, p) ans += a * b ans %= mod print(ans%mod)