#include #include using namespace std; using mint = atcoder::modint998244353; int main(){ int n; cin >> n; vector deg(n,0); for (int i = 0; i < n-1; i++){ int u, v; cin >> u >> v; u--, v--; deg[u]++, deg[v]++; } vector fact(n); fact[0] = 1; for (int i = 1 ; i < n; i++){ fact[i] = fact[i-1] * i; } mint ans = fact[n-1].inv(); for (int i = 0; i < n; i++){ ans *= fact[deg[i]]; } cout << ans.val() << endl; }