#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[200005];
long long int fact[200005];
long long int gcd(long long int a, long long int b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int dfs(long long int node, long long int parent) {
  long long int ways = 1;
  if (adj[node].size() == 1 && parent > 0)
    return 1;
  else {
    long long int sons = 0;
    for (int i = 0; i < adj[node].size(); i++) {
      if (adj[node][i] != parent)
        sons++;
      else
        continue;
      ways *= dfs(adj[node][i], node);
      ways %= 998244353;
    }
    if (parent == -1)
      ways *= fact[sons];
    else
      ways *= fact[sons + 1];
    ways %= 998244353;
    return ways;
  }
}
int main() {
  fact[1] = 1;
  for (int i = 2; i < 200004; i++) fact[i] = (fact[i - 1] * i) % 998244353;
  long long int u, v, n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cout << (n * dfs(1, -1)) % 998244353;
  return 0;
}
