#include <bits/stdc++.h>
using namespace std;
int n, m, num, h[200010], cnt[200010], fac[200010], inv[200010], f[200010];
struct node {
  int to, next;
} mp[200010 << 1];
inline void ins(int x, int y) {
  mp[++num].to = y;
  mp[num].next = h[x];
  h[x] = num;
  mp[++num].to = x;
  mp[num].next = h[y];
  h[y] = num;
}
void dfs(int x, int fa) {
  int tmp = 1, son = 0;
  for (int i = h[x]; i; i = mp[i].next) {
    int y = mp[i].to;
    if (y == fa) continue;
    ++son;
    dfs(y, x);
    tmp = 1ll * tmp * f[y] % 998244353;
  }
  if (x == 1) return;
  f[x] = 1ll * tmp * fac[son] % 998244353 * (son + 1) % 998244353;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    ins(x, y);
  }
  fac[0] = fac[1] = 1;
  for (int i = 2; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % 998244353;
  dfs(1, 0);
  int tmp = 1, son = 0;
  for (int i = h[1]; i; i = mp[i].next) {
    tmp = 1ll * tmp * f[mp[i].to] % 998244353;
    ++son;
  }
  printf("%d\n", 1ll * tmp * fac[son] % 998244353 * n % 998244353);
  return 0;
}
