import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### mod = 998244353 nn = 1000000 fact = [1] * nn for i in range(nn - 1): fact[i + 1] = fact[i] * (i + 1) % mod invfact = [1] * nn invfact[nn - 1] = pow(fact[nn - 1], mod - 2, mod) for i in range(nn - 1)[::-1]: invfact[i] = invfact[i + 1] * (i + 1) % mod def binom(x, y): if x < 0 or y < 0 or x - y < 0: return 0 return fact[x] * invfact[y] % mod * invfact[x - y] % mod n,k = na() if n == 1: print([1,1,3,3,3,1,1][k]) elif n % 2 == 0 and k % 2 == 0: ans = binom(2*n+4, k)+binom(n+2, k//2)*3 elif n % 2 == 0: ans = binom(2*n+4,k) elif k % 2 == 0: ans = binom(2*n+4, k)+binom(n+2, k//2)*2+binom(n+1,k//2)+binom(n+1,k//2-1) else: ans = binom(2*n+4, k)+2 * binom(n+1, (k-1)//2) print(ans * pow(4, mod-2, mod)%mod)