#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); mint ans=1; void dfs(int x,int p){ int k=0; for(auto y:G[x]){ if(y!=p){ dfs(y,x); ans*=factorial[subsize[y]]; subsize[x]+=subsize[y]; k+=subsize[y]; } else{ k++; } } ans*=factorial[G[x].size()]; ans/=factorial[k]; } 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]; dfs(0,-1); cout << ans.val(); }