B. Combo
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

小 K 手上有 $$$n$$$ 张卡牌,每张卡牌的能量值分别为 $$$a_1,a_2,\cdots,a_n$$$。

现在到小 K 的回合,小 K 可以打出若干张卡牌,打出去的总能量是每张打出卡牌能量的乘积,现在小 K 可以打出任意数量张卡牌(可以不打,此时能量为 $$$0$$$)使得总能量尽可能大。

小 K 想知道这个总能量有多大,由于答案可能很大,你需要将答案对 $$$998244353$$$ 取模$$$^{\text{∗}}$$$后再输出。

$$$^{\text{∗}}$$$取模:$$$x$$$ 对 $$$y$$$ 取模表示求 $$$x$$$ 除以 $$$y$$$ 的余数。例如:$$$5$$$ 对 $$$3$$$ 取模等于 $$$2$$$。

Input

第一行输入 $$$1$$$ 个正整数 $$$n\ (1\le n\le 2 \times 10^5)$$$,表示卡牌数量。

第二行输入 $$$n$$$ 个正整数 $$$a_i(1\le a_i\le 10^9)$$$,表示每张卡牌的能量。

Output

共输出 $$$1$$$ 行,表示答案对 $$$998244353$$$ 取模后的结果。

Examples
Input
4
2 3 4 5
Output
120
Input
4
1000000000 1000000000 1000000000 1000000000
Output
433041149