#include #include using mint = atcoder::static_modint<998244353>; //using mint = atcoder::static_modint<1000000007>; using namespace std; using namespace atcoder; using ld = long double; using ll = long long; #define mp(a,b) make_pair(a,b) #define rep(i,s,n) for(int i=s; i dx{1,0,-1,0},dy{0,1,0,-1}; vector> G(200000); vector subsize(200000,1); vector factorial(200001,1),invfactorial(200001,1); mint ans=1; void dfs(int x,int p){ int c=0; if(p!=-1)c++; mint k=1; for(auto y:G[x])if(y!=p){ c++; dfs(y,x); k*=factorial[subsize[y]]; subsize[x]+=subsize[y]; } k*=factorial[c]; if(p!=-1)k*=invfactorial[subsize[x]]; else k*=invfactorial[subsize[x]-1]; ans*=k; // cout << x << " " << k.val() << "\n"; } int main(){ int n;cin >> n; int u,v; rep(i,0,n-1){ cin >> u >> v,u--,v--; G[u].push_back(v); swap(u,v); G[u].push_back(v); } rep(i,1,200001){ factorial[i]=i*factorial[i-1]; invfactorial[i]=factorial[i].inv(); } dfs(0,-1); cout << ans.val(); }