#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  register int ret = 0;
  while (!(ch >= '0' && ch <= '9')) ch = getchar();
  while (ch >= '0' && ch <= '9')
    ret = (ret << 3) + (ret << 1) + (ch ^ 48), ch = getchar();
  return ret;
}
const int maxn = 200010;
const int mod = 998244353;
int n;
struct edge {
  int v, nxt;
} E[maxn * 2];
int p[maxn], eid;
void init() {
  memset(p, -1, sizeof p);
  eid = 0;
}
void insert(int u, int v) {
  E[eid].v = v;
  E[eid].nxt = p[u];
  p[u] = eid++;
}
void insert2(int u, int v) {
  insert(u, v);
  insert(v, u);
}
int size[maxn];
void dfs1(int u, int fa) {
  size[u] = 1;
  for (int i = p[u]; ~i; i = E[i].nxt) {
    int v = E[i].v;
    if (v == fa) continue;
    dfs1(v, u);
    size[u] += size[v];
  }
}
int fac[maxn];
void initFac() {
  fac[0] = 1;
  for (register int i = 1; i < maxn; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
}
long long ans = 1;
long long dfs2(int u, int fa) {
  long long ret = 1;
  int sons = 0;
  for (int i = p[u]; ~i; i = E[i].nxt) {
    int v = E[i].v;
    if (v == fa) continue;
    ret *= dfs2(v, u);
    ret %= mod;
    sons++;
  }
  if (!sons) return ret;
  ret = ret * fac[sons] % mod * (sons + 1) % mod;
  return ret == 0 ? 1 : ret;
}
int main() {
  n = read();
  init();
  initFac();
  for (int i = 1; i <= n - 1; i++) {
    int u = read(), v = read();
    insert2(u, v);
  }
  dfs1(1, -1);
  int sons = 0;
  for (int i = p[1]; ~i; i = E[i].nxt) {
    int v = E[i].v;
    long long tt = dfs2(v, 1);
    ans *= tt;
    ans %= mod;
    sons++;
  }
  ans = ans * fac[sons] % mod * n % mod;
  printf("%lld\n", ans);
  return 0;
}
