#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
using namespace std;
const int N = 2e5 + 5;
const int MOD = 998244353;
vector<int> g[N];
int n, u, v, dp[N], f[N];
void dfs(int u, int o) {
  dp[u] = 1;
  int tot = 0;
  for (int v : g[u]) {
    if (v != o) {
      dfs(v, u);
      dp[u] = (dp[u] * 1LL * dp[v]) % MOD;
      ++tot;
    }
  }
  if (u == 1) tot--;
  dp[u] = (dp[u] * 1LL * (tot + 1) % MOD * f[tot]) % MOD;
}
int main() {
  scanf("%d", &n);
  f[0] = 1;
  for (int i = 1; i <= n; ++i) f[i] = (f[i - 1] * 1LL * i) % MOD;
  for (int i = 1; i < n; ++i)
    scanf("%d %d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  dfs(1, 0);
  printf("%lld\n", dp[1] * 1LL * n % MOD);
  return 0;
}
