#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long N = 2e5 + 9;
long long n, head[N], tot;
long long fac[N], mi[N], f[N], ans;
struct pp {
  long long nxt, to;
} g[N << 1];
void add(long long u, long long v) {
  g[++tot].nxt = head[u], g[tot].to = v, head[u] = tot;
}
void dfs(long long u, long long fa) {
  long long son = 0;
  f[u] = 1;
  for (long long i = head[u]; i != -1; i = g[i].nxt) {
    long long v = g[i].to;
    if (v == fa) continue;
    dfs(v, u);
    son++;
    (f[u] *= f[v]) %= mod;
  }
  if (u != 1) son++;
  (f[u] *= fac[son]) %= mod;
  return;
}
signed main() {
  memset(head, -1, sizeof(head));
  tot = 0;
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    long long u, v;
    scanf("%lld%lld", &u, &v);
    add(u, v);
    add(v, u);
  }
  fac[0] = 1, mi[0] = 1;
  for (long long i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % mod;
  for (long long i = 1; i <= n; i++) mi[i] = (mi[i - 1] * 2) % mod;
  dfs(1, 0);
  printf("%lld\n", f[1] * n % mod);
  return 0;
}
