{"raw_statement":[{"iden":"problem statement","content":"You have coins of denominations $1, 2, \\dots, N$ yen. For each denomination $i$, you have $A_i$ coins.  \nCoins of the same denomination are indistinguishable.\nFind the number of ways to pay exactly $N$ yen using these coins, and output the result modulo $998244353$.  \nTwo payment methods are considered different if there exists at least one denomination for which the number of coins used differs."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2.5 \\times 10^5$\n*   $1 \\leq A_i \\leq N$\n*   All input values are integers"},{"iden":"input","content":"The input is given from standard input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"3\n1 2 3"},{"iden":"sample output 1","content":"2\n\nThere are $2$ ways to pay exactly $3$ yen:\n\n*   Use one $1$\\-yen coin and one $2$\\-yen coin.\n*   Use one $3$\\-yen coin."},{"iden":"sample input 2","content":"10\n3 1 4 1 5 9 2 6 5 3"},{"iden":"sample output 2","content":"20"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}