{"raw_statement":[{"iden":"problem statement","content":"Given are a sequence of $N$ integers $A_1$, $A_2$, $\\ldots$, $A_N$ and a positive integer $S$.  \nFor a pair of integers $(L, R)$ such that $1\\leq L \\leq R \\leq N$, let us define $f(L, R)$ as follows:  \n\n*   $f(L, R)$ is the number of sequences of integers $(x_1, x_2, \\ldots , x_k)$ such that $L \\leq x_1 < x_2 < \\cdots < x_k \\leq R$ and $A_{x_1}+A_{x_2}+\\cdots +A_{x_k} = S$.\n\nFind the sum of $f(L, R)$ over all pairs of integers $(L, R)$ such that $1\\leq L \\leq R\\leq N$. Since this sum can be enormous, print it modulo $998244353$."},{"iden":"constraints","content":"*   All values in input are integers.\n*   $1 \\leq N \\leq 3000$\n*   $1 \\leq S \\leq 3000$\n*   $1 \\leq A_i \\leq 3000$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $S$\n$A_1$ $A_2$ $...$ $A_N$"},{"iden":"sample input 1","content":"3 4\n2 2 4"},{"iden":"sample output 1","content":"5\n\nThe value of $f(L, R)$ for each pair is as follows, for a total of $5$.\n\n*   $f(1,1) = 0$\n*   $f(1,2) = 1$ (for the sequence $(1, 2)$)\n*   $f(1,3) = 2$ (for $(1, 2)$ and $(3)$)\n*   $f(2,2) = 0$\n*   $f(2,3) = 1$ (for $(3)$)\n*   $f(3,3) = 1$ (for $(3)$)"},{"iden":"sample input 2","content":"5 8\n9 9 9 9 9"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"10 10\n3 1 4 1 5 9 2 6 5 3"},{"iden":"sample output 3","content":"152"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}