시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB10109100.000%

문제

There is an undirected tree named $T$ with $N$ vertices numbered $1$ to $N$. The edge between vertices $u$ and $v$ in $T$ is denoted by $\{u, v\}$.

Consider $P = (p_1, p_2, \dots , p_N)$ as a permutation of $(1, 2, \dots , N)$. Among the $N!$ possible permutations, compute the number of $P$s which satisfy the condition below.

  • If $T$ has an edge $\{u, v\}$, then also has an edge $\{p_u, p_v\}$.

Since the answer may be very large, print the answer modulo $998\,244\,353$.

입력

The input consists of a single test case of the following format.

$N$

$u_1$ $v_1$

$u_2$ $v_2$

$\vdots$

$u_{N-1}$ $v_{N-1}$

The first line consists of an integer $N$ between $1$ and $100\,000$. This represents the number of vertices in the tree $T$.

The $i$-th of the following $N-1$ lines consists of two integers between $1$ and $N$. This represents that there is an edge $\{u_i, v_i\}$ in the tree $T$.

It is guaranteed that the given graph is a tree.

출력

Output the answer modulo $998\,244\,353$ in a line.

예제 입력 1

4
1 2
1 3
1 4

예제 출력 1

6

예제 입력 2

4
1 2
2 3
3 4

예제 출력 2

2

예제 입력 3

6
1 3
2 3
3 4
4 5
4 6

예제 출력 3

8