#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353;
const int M = 200005;
int n, tot, head[M], Next[M * 2], vet[M * 2], c[M];
long long ans, f[M];
void add(int a, int b) {
  Next[++tot] = head[a], vet[tot] = b;
  head[a] = tot;
}
void dfs(int x, int pre) {
  c[x] = 1;
  for (int i = head[x]; i; i = Next[i]) {
    int y = vet[i];
    if (y == pre) continue;
    dfs(y, x);
    c[x]++;
  }
  ans = (ans * f[c[x]]) % P;
}
int main() {
  scanf("%d", &n);
  f[0] = 1;
  for (int i = 1; i <= n - 1; i++) {
    f[i] = (f[i - 1] * i) % P;
    int a, b;
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  ans = n;
  for (int i = head[1]; i; i = Next[i]) {
    dfs(vet[i], 1);
    c[1]++;
  }
  ans = (ans * f[c[1]]) % P;
  cout << ans;
  return 0;
}
