#include <bits/stdc++.h>
const int N = 2e5 + 5, mo = 998244353;
int n, u, v, d[N], fac[N], i, s1 = 1;
int main() {
  for (i = *fac = 1; i < N; ++i) fac[i] = 1ll * fac[i - 1] * i % mo;
  scanf("%d", &n);
  for (i = 1; i < n; ++i) scanf("%d%d", &u, &v), ++d[u], ++d[v];
  for (i = 1; i <= n; ++i) s1 = 1ll * s1 * fac[d[i]] % mo;
  s1 = 1ll * s1 * n % mo;
  printf("%d\n", s1);
  return 0;
}
