#include <bits/stdc++.h>
using namespace std;
int const maxn = 2e5 + 5;
int const mod = 998244353;
vector<int> p[maxn];
long long dp[maxn], jie[maxn];
void dfs(int u, int first) {
  dp[u] = 1;
  if (p[u].size() == 1 && u != 1) return;
  for (auto it : p[u]) {
    if (it == first) continue;
    dfs(it, u);
    dp[u] = dp[u] * dp[it] % mod;
  }
  dp[u] = dp[u] * jie[p[u].size()] % mod;
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  jie[0] = jie[1] = 1;
  for (long long i = 2; i <= n; i++) jie[i] = jie[i - 1] * i % mod;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    p[u].push_back(v);
    p[v].push_back(u);
  }
  dfs(1, -1);
  printf("%lld\n", dp[1] * n % mod);
}
