#include <bits/stdc++.h>
struct Tree {
  int64_t val;
  std::vector<Tree*> children;
};
const int64_t mod = 998244353;
std::vector<int64_t> factors;
int64_t counter(Tree* root, int64_t depth = 0) {
  if (root->children.size() == 0) return 1;
  int64_t res = 1;
  for (auto i : root->children) {
    res *= counter(i, depth + 1);
    res %= mod;
  }
  if (!depth)
    res *= factors[root->children.size()];
  else
    res *= factors[root->children.size() + 1];
  return res % mod;
}
int main() {
  int64_t n;
  std::cin >> n;
  std::map<int64_t, Tree*> nodes;
  std::vector<std::vector<int64_t>> edges(n);
  for (int64_t i = 0; i < n - 1; ++i) {
    int64_t a, b;
    std::cin >> a >> b;
    a--;
    b--;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  factors.push_back(1);
  for (int64_t i = 0; i < n; ++i) {
    factors.push_back((*factors.rbegin() * (i + 1)) % mod);
  }
  for (int64_t i = 0; i < n; ++i) {
    Tree* t = new Tree;
    nodes.insert(std::make_pair(i, t));
  }
  std::vector<bool> used(n, false);
  std::queue<int64_t> worklist;
  worklist.push(0);
  while (!worklist.empty()) {
    auto i = worklist.front();
    worklist.pop();
    used[i] = true;
    ;
    for (auto j : edges[i]) {
      if (used[j]) continue;
      worklist.push(j);
      nodes[i]->children.push_back(nodes[j]);
    }
  }
  std::cout << (counter(nodes[0]) * n) % mod << std::endl;
  return 0;
}
