N,K=map(int,input().split()) M=70 DP=[[[0]*(M+1) for i in range(M+1)] for j in range(M+1)] DP[0][0][0]=1 mod=998244353 for i in range(1,M+1): for j in range(M): for k in range(j,M): if (K>>(M-i))&1: if (N>>(M-i))&1: DP[i][0][k-j+1]=(DP[i][0][k-j+1]+DP[i-1][j][k])%mod DP[i][j+1][k+1]=(DP[i][j+1][k+1]+DP[i-1][j][k])%mod else: if (N>>(M-i))&1: DP[i][j+1][k+1]=(DP[i][j+1][k+1]+DP[i-1][j][k])%mod DP[i][0][k]=(DP[i][0][k]+DP[i-1][j][k])%mod ANS=0 T=[1] for i in range(M+1): T.append(T[i]*2%mod) for i in range(M+1): for j in range(M+1): ANS+=DP[M][i][j]*T[j]%mod print(ANS%mod)