#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}; int main(){ int n;cin >> n; vector cnt(n+1); int u,v; rep(i,1,n){ cin >> u >> v; cnt[u]++,cnt[v]++; } mint ans=1; vector factorial(n+11,1); rep(i,1,n+1)factorial[i]=i*factorial[i-1]; rep(i,1,n+1)ans*=factorial[cnt[i]]; ans/=factorial[n-1]; cout << ans.val(); }