Finally, Non Ad-Hoc Problem

 You are given two integers $A$ and $N$. Calculate number of permutations $p$ of length $N$ such that $i - N + A < p_i < i + A$ for $1 \le i \le N$. Since this number can be very large, calculate it modulo $998244353$.

Input Format

The only line of the input contains two integers $N$, $A$.

Output Format

Output the number of permutations modulo $998244353$.

Constraints

  • $2 \le N \le 10^9$
  • $1 \le A \le min(500000, N-1)$

Sample Input 1 

4 2

Sample Output 1 

5

Explanation

We need $1 \le p_1 \le 2$, $1 \le p_2 \le 3$, $2 \le p_3 \le 4$, $3 \le p_4 \le 4$.

There are $5$ such permutations: $(1, 2, 3, 4), (1, 2, 4, 3), (1, 3, 2, 4), (2, 1, 3, 4), (2, 1, 4, 3)$.

Sample Input 2 

322 228

Sample Output 2 

842567743
Previous
Next Post »