#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> adj[signed(2e5 + 5)];
bool seen[signed(2e5 + 5)];
long long fact[signed(2e5 + 5)];
long long root(long long v) {
  seen[v] = true;
  vector<long long> ch;
  long long res = 1;
  for (auto e : adj[v])
    if (!seen[e]) {
      seen[e] = true;
      ch.emplace_back(e);
      long long sub = root(e);
      res = (res * sub) % 998244353;
    }
  if (v == 1) {
    res = (res * fact[ch.size()]) % 998244353;
  } else {
    res = (res * fact[ch.size() + 1]) % 998244353;
  }
  return res;
}
signed main() {
  scanf("%lld", &n);
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    scanf("%lld%lld", &u, &v);
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
  }
  fact[0] = 1;
  for (long long i = 1; i < signed(2e5 + 5); ++i) {
    fact[i] = (fact[i - 1] * i) % 998244353;
  }
  printf("%lld", (root(1) * n) % 998244353);
}
