#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
inline long long read() {
  int ch = getchar(), f = 1;
  long long ans = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = 0;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    ans = (((ans << 2) + ans) << 1) + (ch ^ '0');
  return f ? ans : -ans;
}
int n;
const int maxn = 200005;
vector<int> e[maxn];
const int mod = 998244353;
int siz[maxn];
long long fac[maxn];
long long ans = 1;
void dfs(int u, int f) {
  if (u > 1) siz[u] = 1;
  for (int v : e[u])
    if (v != f) dfs(v, u), siz[u]++;
  ans = 1LL * ans * fac[siz[u]] % mod;
}
int main() {
  n = read();
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
  for (int i = 1; i < n; ++i) {
    int u = read(), v = read();
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 0);
  printf("%I64d\n", ans * n % mod);
  return 0;
}
