#include <bits/stdc++.h>
using namespace std;
long long fact[200005];
vector<long long> graph[200004];
long long dfs(long long u, long long p, long long f) {
  long long ans = 1;
  long long c = 0;
  for (auto i : graph[u]) {
    if (i != p) {
      c++;
      ans = (ans * dfs(i, u, 1)) % 998244353;
    }
  }
  if (f == 0)
    ans = (ans * fact[c]) % 998244353;
  else
    ans = (ans * fact[(c + 1)]) % 998244353;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fact[0] = 1;
  for (long long i = 1; i < 200005; i++)
    fact[i] = (fact[i - 1] * i) % 998244353;
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  long long ans = 0;
  ans = (dfs(1, 0, 0) * n) % 998244353;
  cout << ans;
}
