#include <bits/stdc++.h>
const int maxn = 200100;
const int MOD = 998244353;
struct Edge {
  int u, v, nxt;
} e[2 * maxn];
int head[maxn], e_cnt, f[maxn];
void Add(int u, int v) {
  e[e_cnt] = (Edge){u, v, head[u]};
  head[u] = e_cnt++;
}
int DFS(int u, int fa) {
  int dp = 1, son = 0;
  for (int id = head[u]; id != -1; id = e[id].nxt) {
    int v = e[id].v;
    if (v == fa) continue;
    dp = 1ll * dp * DFS(v, u) % MOD;
    ++son;
  }
  dp = 1ll * dp * f[son + (u != 1)] % MOD;
  return dp;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) f[i] = i == 1 ? 1 : 1ll * f[i - 1] * i % MOD;
  for (int i = 1; i <= n; ++i) head[i] = -1;
  e_cnt = 0;
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    Add(u, v);
    Add(v, u);
  }
  printf("%d\n", 1ll * n * DFS(1, 0) % MOD);
  return 0;
}
