#include <bits/stdc++.h>
int n;
int cnt, first[200010];
struct edge {
  int v, nx;
} o[500010];
void add(int u, int v) { o[++cnt].v = v, o[cnt].nx = first[u], first[u] = cnt; }
int f[200010], du[200010], size[200010], fac[200010];
void dfs(int x, int fa) {
  f[x] = size[x] = 1;
  du[x] = 0;
  for (int i = first[x]; i; i = o[i].nx)
    if (o[i].v != fa) {
      dfs(o[i].v, x);
      ++du[x];
      size[x] += size[o[i].v];
      f[x] = 1ll * f[x] * f[o[i].v] % 998244353 * du[x] % 998244353 *
             (du[o[i].v] + 1) % 998244353;
    }
}
int main() {
  scanf("%d", &n);
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1LL * fac[i - 1] * i % 998244353;
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs(1, 1);
  printf("%I64d\n", 1ll * f[1] * n % 998244353);
}
