#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> G[200005];
long long ans = 1;
long long fact[200005];
void dfs(int v, int p) {
  int len = G[v].size();
  ans = ans * fact[len] % 998244353LL;
  for (int i = 0; i < G[v].size(); i++) {
    if (G[v][i] == p) continue;
    dfs(G[v][i], v);
  }
}
int main(void) {
  fact[0] = 1;
  for (long long i = 1; i <= 200000; i++) {
    fact[i] = fact[i - 1] * i % 998244353LL;
  }
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(0, -1);
  ans *= n;
  ans %= 998244353LL;
  printf("%lld\n", ans);
  return 0;
}
