#P2337. Training

Training

GSS has a huge problem set for training. The problem set consists of n types of problems, for

example dynamic programming, graph theory, data structures and so on. For the i-th type of

problem, GSS has k i problems. And each day, GSS will pick one problem from his problem set in

random and solve that. After that, he will remove that problem from the problem set and never

pick it again.

GSS found that if he has solve at least one problem from each type, he will become very moe.

(But he doesn’t know why he will become moe.) And he wants to know the expected time to solve

at least one problem from each of the n types.

Input

The first line of input is an integer n. (0 < n ≤ 50)

The second line contains n positive integers, k 1 ,k 2 ,...k n (n ≤∑k i ≤ 1000)

Output

Output the expected time to solve at least one problem from each of the n types.

If your answer is p/q, then you should output pw module 998244353.

Where w = q 998244351 .

Sample Input

5
1 1 1 1 1

2 2 2

Sample Output

</p>
5


332748120

HINT

In the second sample, the mean time for GSS to solve each type of problem at least one time is


2 × 2/3 + 3 × 1/3 = 14/6.


998244353 = 2 23 × 7 × 17 + 1 and it is a prime.

Source