# https://yukicoder.me/problems/no/3809 MOD = 998244353 # ソースコードの出典URL: https://github.com/LyricalMaestro/at_coder_snippets/blob/af67863a2fe7f16cce8325bbc531f89968bfa525/src/conbination.py class CombinationCalculator: """ modを考慮したPermutation, Combinationを計算するためのクラス """ def __init__(self, size, mod): self.mod = mod self.factorial = [0] * (size + 1) self.factorial[0] = 1 for i in range(1, size + 1): self.factorial[i] = (i * self.factorial[i - 1]) % self.mod self.inv_factorial = [0] * (size + 1) self.inv_factorial[size] = pow(self.factorial[size], self.mod - 2, self.mod) for i in reversed(range(size)): self.inv_factorial[i] = ((i + 1) * self.inv_factorial[i + 1]) % self.mod def calc_combination(self, n, r): if n < 0 or n < r or r < 0: return 0 if r == 0 or n == r: return 1 ans = self.inv_factorial[n - r] * self.inv_factorial[r] ans %= self.mod ans *= self.factorial[n] ans %= self.mod return ans def calc_permutation(self, n, r): if n < 0 or n < r: return 0 ans = self.inv_factorial[n - r] ans *= self.factorial[n] ans %= self.mod return ans def linear_sum(N): return (N * (N + 1)) // 2 def main(): N, K = map(int, input().split()) numbers = [i + 1 for i in reversed(range(2 * N))] combi = CombinationCalculator(N, MOD) max_sum = linear_sum(2 * N) - linear_sum(N) if max_sum < K: print(0) return dp = {0: 1} for n in numbers: new_dp = {} for key, value in dp.items(): used_sum = key // (2 * N) not_used_count = key % (2 * N) # 利用しない if not_used_count + 1 <= N: new_key = used_sum * (2 * N) + not_used_count + 1 if new_key not in new_dp: new_dp[new_key] = 0 new_dp[new_key] += value new_dp[new_key] %= MOD # 利用する if used_sum + n <= K and not_used_count >= 1: new_key = (used_sum + n) * (2 * N) + not_used_count - 1 if new_key not in new_dp: new_dp[new_key] = 0 new_dp[new_key] += (value * not_used_count) % MOD new_dp[new_key] %= MOD dp = new_dp ans = K * 2 * N if ans in dp: answer = (dp[ans] * combi.factorial[N]) % MOD print(answer) else: print(0) if __name__ == "__main__": main()