#include #include using ll = long long; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; struct edge { int to; edge(int _to) : to(_to) {} }; vector> G(n); for (int i = 0; i < n - 1; ++i) { int a, b; cin >> a >> b; a--, b--; G[a].emplace_back(b); G[b].emplace_back(a); } if (n <= 3) { cout << 1 << endl; return 0; } using mint = atcoder::modint998244353; vector factorial(n + 1); factorial[0] = 1; for (int i = 1; i <= n; ++i) { factorial[i] = factorial[i - 1] * i; } vector seen(n); auto dfs = [&](auto dfs, int u) -> mint { seen.at(u) = true; mint res = 1; int cnt = 0; for (const auto &e : G.at(u)) { if (seen.at(e.to)) continue; res *= dfs(dfs, e.to); cnt++; } res *= factorial[cnt + 1]; return res; }; mint num = dfs(dfs, 0) / 2; mint den = factorial[n - 1]; cout << (num / den).val() << endl; return 0; }