#include <bits/stdc++.h>
using namespace std;
template <typename I>
I pow(I x, I d, I p) {
  I res(1);
  for (; d > 0; d >>= 1, x = x * x % p)
    if (d & 1) res = res * x % p;
  return res;
}
class Solver {
  const long long p = 998244353;
  int n;
  vector<long long> F;
  vector<bool> visited;
  const vector<vector<int>>& G;
  long long dfs(int u);

 public:
  Solver(const vector<vector<int>>& G_);
  long long solve();
};
int main() {
  int n;
  scanf("%d", &n);
  int u, v;
  vector<vector<int>> G(n);
  for (int e = 1; e < n; ++e) {
    scanf("%d %d", &u, &v);
    G[u - 1].push_back(v - 1);
    G[v - 1].push_back(u - 1);
  }
  Solver S(G);
  printf("%lld\n", S.solve());
}
Solver::Solver(const vector<vector<int>>& G_)
    : n(G_.size()), G(G_), F(G_.size()), visited(G_.size()) {
  F[0] = 1;
  for (int i = 1; i < n; ++i) F[i] = F[i - 1] * i % p;
}
long long Solver::dfs(int u) {
  visited[u] = true;
  long long res = 1;
  for (int v : G[u])
    if (!visited[v]) res = res * dfs(v) % p;
  return res * F[G[u].size()] % p;
}
long long Solver::solve() { return n * dfs(0) % p; }
