#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const int maxn = 2e5 + 5, mod = 998244353;
int n;
vector<int> g[maxn];
int de[maxn];
const int rt = 1;
int vis[maxn], fac[maxn];
int dp[maxn];
int dfs(int cur, int fat = -1) {
  if (fat != -1 && g[cur].size() == 1) {
    dp[cur] = 1;
    return dp[cur];
  }
  int gn = g[cur].size(), res = 1;
  for (int i = 0; i < gn; i++) {
    int u = g[cur][i];
    if (u == fat) continue;
    res = 1ll * res * dfs(u, cur) % mod;
  }
  res = 1ll * res * fac[de[cur] + (cur != rt)] % mod;
  return dp[cur] = res;
}
void init() {
  fac[0] = 1;
  for (int i = 1; i <= 200000; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
}
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
    ++de[x];
    ++de[y];
  }
  for (int i = 2; i <= n; i++) --de[i];
  int ans = dfs(1);
  printf("%d\n", 1ll * ans * n % mod);
  return 0;
}
