def dice_remainder_probability(N, K): dp = [[0 for _ in range(6*N+1)] for _ in range(2)] dp[0][0] = 1 for i in range(N): dp[(i+1)%2] = [0 for _ in range(6*N+1)] for j in range(6*i+1): for k in range(1, 7): dp[(i+1)%2][j+k] += dp[i%2][j] total = 0 for i in range(K, 6*N+1, 6): total += dp[N%2][i] return total, 6**N def mod_inverse(a, m): g, x, y = extended_gcd(a, m) if g != 1: raise Exception('M') else: return x % m def extended_gcd(a, b): if a == 0: return b, 0, 1 else: g, x, y = extended_gcd(b % a, a) return g, y - (b // a) * x, x N, K = map(int, input().split()) P, Q = dice_remainder_probability(N, K) R = (P * mod_inverse(Q, 998244353)) % 998244353 print(R)