시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB64466.667%

문제

You are given a permutation of length $n$ and an integer $k$.

An element is called a record if it is strictly greater than all the elements before it.

Calculate the sum of $(-1)^{\mathit{len}}$ over all subsequences that have exactly $k$ records. Here $\mathit{len}$ is the number of elements in the subsequence. Since the answer can be large, calculate it modulo $998\,244\,353$.

입력

The first line contains two integers $n$ and $k$ ($1 \le k \le n \le 10^6$).

The second line contains the permutation $p_1, p_2, \ldots, p_n$.

출력

I'll let you guess this one.

예제 입력 1

5 2
4 1 2 5 3

예제 출력 1

3

예제 입력 2

7 3
1 2 3 4 5 6 7

예제 출력 2

998244318

예제 입력 3

5 5
2 5 4 1 3

예제 출력 3

0

노트

In the second sample all of subsequences of length 3 have exactly 3 records, and none other subsequences have exactly 3 records, so the sum is equal to $(-1)^3 \binom{7}{3} = -35$, which is $998\,244\,318$ modulo $998\,244\,353$.

In the third sample none of the subsequences have exactly 5 records, and the sum of empty set is 0.