Journey

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

There are nn cells along a straight line numbered from 11 to nn. Each cell ii contains a number a_ia\_i. Initially, the player is in the cell number 11 with the number h_0h\_0 in his hand. 

If the player is in a cell number pp (1pn1 \le p \le n) with a number hh in hand, he can jump to the cell number p+a_pp + a\_p or to the cell number p+hp + 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 11 to the cell nn. Two paths are considered different if their sets of visited cells are different. Print the answer modulo 998,244,353998\\,244\\,353.

입력

The first line contains two integers nn and h_0h\_0: the number of cells on the line and the number in the player's hand before the start of the path (2n100,0002 \le n \le 100\\,000; 1h_0n11 \le h\_0 \le n - 1).

The second line contains nn integers a_1a\_1, a_2a\_2, \ldots, a_na\_n. Here, a_ia\_i is the number in ii-th cell (1a_in11 \le a\_i \le n - 1).

출력

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