#include <bits/stdc++.h>
int const N = 200000;
int const MOD = 998244353;
struct Edge {
  int to;
  int next;
  Edge(int t = 0, int n = 0) : to(t), next(n) {}
};
Edge edges[2 * N + 1];
int edges_top;
int node[N + 1];
int number[N + 1];
int dp[N + 1];
void add(int, int);
void dfs(int, int);
void dfs(int root, int father) {
  number[root] = 1;
  dp[root] = 1;
  int cnt = 0;
  for (int i = node[root]; i; i = edges[i].next) {
    int to = edges[i].to;
    if (to != father) {
      dfs(to, root);
      number[root] += number[to];
      cnt++;
      dp[root] = 1ll * cnt * dp[to] % MOD * dp[root] % MOD;
    }
  }
  if (root == 1) {
    dp[root] = 1ll * dp[root] * number[root] % MOD;
  } else {
    dp[root] = 1ll * dp[root] * (cnt + 1) % MOD;
  }
}
void add(int a, int b) {
  edges_top++;
  edges[edges_top] = Edge(b, node[a]);
  node[a] = edges_top;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  int n;
  std::cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    std::cin >> u >> v;
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  std::cout << dp[1];
  return 0;
}
