#include <bits/stdc++.h>
void err() { std::cout << std::endl; }
template <typename T, typename... Args>
void err(T a, Args... args) {
  std::cout << a << ' ';
  err(args...);
}
using namespace std;
const int mod = 998244353;
const int inf = 1 << 30;
const int maxn = 200000 + 5;
int n, f[maxn], siz[maxn];
vector<int> edge[maxn];
int dfs(int u, int ff) {
  siz[u] = 1;
  int r = 1;
  for (int& v : edge[u]) {
    if (v == ff) continue;
    r = 1ll * r * dfs(v, u) % mod;
    r = 1ll * r * (int)(edge[v].size()) % mod;
    siz[u] += siz[v];
  };
  int sz = (int)edge[u].size();
  if (u != 1) sz--;
  return 1ll * r * f[sz] % mod;
}
int main() {
  f[0] = 1;
  for (int i = 1; i < maxn; i++) f[i] = 1ll * i * f[i - 1] % mod;
  scanf("%d", &n);
  for (int i = 2, u, v; i <= n; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  int ans = dfs(1, 0);
  cout << 1ll * n * ans % mod;
  return 0;
}
