#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long mod = 998244353;
const int maxn = 2e5 + 5;
int dg[maxn], N;
long long ans = 1;
long long fac[maxn];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    dg[a]++;
    dg[b]++;
  }
  fac[0] = 1;
  for (int i = 1; i <= N; i++) {
    fac[i] = fac[i - 1] * i % mod;
  }
  for (int i = 1; i <= N; i++) {
    ans = ans * fac[dg[i]] % mod;
  }
  printf("%lld\n", ans * N % mod);
}
