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(((K+2)%7>3)*2+1if N<2 else(C(2*N+4,K)+C(N+2-K%2,K//2)*[3,[0,2][N%2]][K%2])*748683265%P)