{"raw_statement":[{"iden":"problem statement","content":"Given is an integer sequence $D_1,...,D_N$ of $N$ elements. Find the number, modulo $998244353$, of trees with $N$ vertices numbered $1$ to $N$ that satisfy the following condition:\n\n*   For every integer $i$ from $1$ to $N$, the distance between Vertex $1$ and Vertex $i$ is $D_i$."},{"iden":"notes","content":"*   A tree of $N$ vertices is a connected undirected graph with $N$ vertices and $N-1$ edges, and the distance between two vertices are the number of edges in the shortest path between them.\n*   Two trees are considered different if and only if there are two vertices $x$ and $y$ such that there is an edge between $x$ and $y$ in one of those trees and not in the other."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^5$\n*   $0 \\leq D_i \\leq N-1$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$D_1$ $D_2$ $...$ $D_N$"},{"iden":"sample input 1","content":"4\n0 1 1 2"},{"iden":"sample output 1","content":"2\n\nFor example, a tree with edges $(1,2)$, $(1,3)$, and $(2,4)$ satisfies the condition."},{"iden":"sample input 2","content":"4\n1 1 1 1"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"7\n0 3 2 1 2 2 1"},{"iden":"sample output 3","content":"24"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}