atcoder#ABC258H. [ABC258Ex] Odd Steps

[ABC258Ex] Odd Steps

Score : 600600 points

Problem Statement

Find the number, modulo 998244353998244353, of sequences XX that satisfy all of the following conditions.

  • Every term in XX is a positive odd number.
  • The sum of the terms in XX is SS.
  • The prefix sums of XX contain none of A1,,ANA_1, \dots, A_N. Formally, if we define Yi=X1++XiY_i = X_1 + \dots + X_i for each ii, then YiAjY_i \neq A_j holds for all integers ii and jj such that 1iX1 \leq i \leq |X| and 1jN1 \leq j \leq N.

Constraints

  • 1N1051 \leq N \leq 10^5
  • $1 \leq A_1 \lt A_2 \lt \dots \lt A_N \lt S \leq 10^{18}$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN SS

A1A_1 \ldots ANA_N

Output

Print the answer.

3 7
2 4 5
3

The following three sequences satisfy the conditions.

  • (1,5,1)(1, 5, 1)
  • (3,3,1)(3, 3, 1)
  • (7)(7)
5 60
10 20 30 40 50
37634180
10 1000000000000000000
1 2 4 8 16 32 64 128 256 512
75326268