#include <bits/stdc++.h>
using namespace std;
const int rw = 998244353;
int ksm(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = 1LL * x * ans % rw;
    x = 1LL * x * x % rw;
    y >>= 1;
  }
  return ans;
}
int n;
int deg[200005], fac[300005], ni[300005];
int main() {
  fac[0] = 1;
  for (int i = 1; i <= 300000; i++) fac[i] = 1LL * fac[i - 1] * i % rw;
  ni[300000] = ksm(fac[300000], rw - 2);
  for (int i = 300000; i; i--) ni[i - 1] = 1LL * ni[i] * i % rw;
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++) {
    scanf("%d%d", &x, &y);
    deg[x]++;
    deg[y]++;
  }
  int ans = fac[deg[1]];
  for (int i = 2; i <= n; i++) {
    ans = 1LL * ans * fac[deg[i]] % rw;
  }
  printf("%lld", 1LL * ans * n % rw);
}
