{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence of $N$ non-negative integers: $D=(D_1, D_2, \\dots, D_N)$.\nFind the number of labeled trees with $N$ vertices numbered $1$ to $N$ that satisfy the following condition, modulo $998244353$.\n\n*   There is a way to direct the $N-1$ edges so that the outdegree of each vertex $i\\ (1\\leq i \\leq N)$ is $D_i$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq D_i \\leq N-1$\n*   $\\sum_{i=1}^{N} D_i = N-1$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$D_1$ $D_2$ $\\dots$ $D_N$"},{"iden":"sample input 1","content":"4\n0 1 0 2"},{"iden":"sample output 1","content":"5\n\nBelow are the five trees that satisfy the condition, directed in a desired way.\n![image](https://img.atcoder.jp/arc155/5b5b99752b5330a2dd41607c3946fdd4.jpg)"},{"iden":"sample input 2","content":"5\n0 1 1 1 1"},{"iden":"sample output 2","content":"125"},{"iden":"sample input 3","content":"15\n0 0 0 0 0 0 0 1 1 1 1 1 2 3 4"},{"iden":"sample output 3","content":"63282877"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}