시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB75480.000%

문제

There are $n$ cells along a straight line numbered from $1$ to $n$. Each cell $i$ contains a number $a_i$. Initially, the player is in the cell number $1$ with the number $h_0$ in his hand. 

If the player is in a cell number $p$ ($1 \le p \le n$) with a number $h$ in hand, he can jump to the cell number $p + a_p$ or to the cell number $p + h$. It is forbidden to leave the field. After the jump, the new number in the player's hand is equal to the length of the last jump.

You have to calculate the number of paths from the cell $1$ to the cell $n$. Two paths are considered different if their sets of visited cells are different. Print the answer modulo $998\,244\,353$.

입력

The first line contains two integers $n$ and $h_0$: the number of cells on the line and the number in the player's hand before the start of the path ($2 \le n \le 100\,000$; $1 \le h_0 \le n - 1$).

The second line contains $n$ integers $a_1$, $a_2$, $\ldots$, $a_n$. Here, $a_i$ is the number in $i$-th cell ($1 \le a_i \le n - 1$).

출력

Print a single integer: the number of different paths modulo $998\,244\,353$.

예제 입력 1

5 1
2 3 2 4 3

예제 출력 1

4