AT_fps_24_n 硬貨 2
Description
You have coins of denominations $ 1, 2, \dots, N $ yen. For each denomination $ i $ , you have $ A_i $ coins.
Coins of the same denomination are indistinguishable.
Find the number of ways to pay exactly $ N $ yen using these coins, and output the result modulo $ 998244353 $ .
Two payment methods are considered different if there exists at least one denomination for which the number of coins used differs.
Input Format
The input is given from standard input in the following format:
> $ N $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
There are $ 2 $ ways to pay exactly $ 3 $ yen:
- Use one $ 1 $ -yen coin and one $ 2 $ -yen coin.
- Use one $ 3 $ -yen coin.
### Constraints
- $ 1 \leq N \leq 2.5 \times 10^5 $
- $ 1 \leq A_i \leq N $
- All input values are integers