#include <bits/stdc++.h>
const int maxn = 200005;
const long long mod = 998244353LL;
int head[maxn], to[maxn * 2], next[maxn * 2], lb;
int n, son[maxn];
long long f[maxn], fact[maxn];
inline void ist(int aa, int ss) {
  to[lb] = ss;
  next[lb] = head[aa];
  head[aa] = lb;
  ++lb;
}
void dfs(int r, int p) {
  f[r] = 1LL;
  for (int j = head[r]; j != -1; j = next[j]) {
    if (to[j] == p) {
      continue;
    }
    dfs(to[j], r);
    ++son[r];
    f[r] = f[r] * (son[to[j]] + 1) % mod * f[to[j]] % mod;
  }
  f[r] = f[r] * fact[son[r]] % mod;
}
int main() {
  memset(head, -1, sizeof head);
  memset(next, -1, sizeof next);
  scanf("%d", &n);
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fact[i] = fact[i - 1] * i % mod;
  }
  int t1, t2;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &t1, &t2);
    ist(t1, t2);
    ist(t2, t1);
  }
  dfs(1, 0);
  printf("%d\n", (int)(f[1] * n % mod));
  return 0;
}
