{"raw_statement":[{"iden":"problem statement","content":"You are given integers $N$ and $K$, and a permutation $P=(P_1,P_2,\\cdots,P_N)$ of $(1,2,\\cdots,N)$.\nYou can perform the following operation any number of times, possibly zero.\n\n*   Choose an integer $i$ ($1 \\leq i \\leq N-K+1$). Swap the values of the two greatest elements among $P_i,P_{i+1},\\cdots,P_{i+K-1}$.\n\nFind the number, modulo $998244353$, of permutations that $P$ can be after your operations."},{"iden":"constraints","content":"*   $2 \\leq K \\leq N \\leq 250000$\n*   $(P_1,P_2,\\cdots,P_N)$ is a permutation of $(1,2,\\cdots,N)$.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $K$\n$P_1$ $P_2$ $\\cdots$ $P_N$"},{"iden":"sample input 1","content":"3 3\n2 3 1"},{"iden":"sample output 1","content":"2\n\nIn this case, the operation can only be performed with $i=1$.\nAfter one operation, the two greatest elements among $P_1,P_2,P_3$, which are $P_2=3$ and $P_1=2$, have their values swapped, and you have $P=(3,2,1)$. After one more operation, you have $P=(2,3,1)$.\nThus, there are two permutations, $P=(2,3,1),(3,2,1)$, that $P$ can be after your operations."},{"iden":"sample input 2","content":"3 2\n1 3 2"},{"iden":"sample output 2","content":"6"},{"iden":"sample input 3","content":"10 5\n1 2 3 4 5 6 7 8 9 10"},{"iden":"sample output 3","content":"144"},{"iden":"sample input 4","content":"20 5\n8 13 6 11 20 3 12 18 17 4 10 1 7 16 19 5 2 15 14 9"},{"iden":"sample output 4","content":"1451520"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}