N,K=map(int,input().split()) P=998244353 def C(x,y): a=1 for i in range(y):a=(a*(x-i)*pow(i+1,-1,P))%P return a print([1,1,3,3,3,1,1][K]if N<2 else(C(2*N+4,K)+C(N+2-K%2,K//2)*[3,[0,2][N%2]][K%2])*748683265%P)