#include <bits/stdc++.h>
const int md = 998244353;
inline int mul(int a, int b) { return (long long)a * b % md; }
const int N = 200000;
int n;
std::vector<int> g[N];
int dfs(int v, int pr) {
  int k = 1, p = 1;
  for (int i = 0, j = 0; i < (int)g[v].size(); ++i)
    if (g[v][i] != pr) {
      p = mul(p, j + 2);
      k = mul(k, dfs(g[v][i], v));
      ++j;
    }
  return mul(p, k);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a - 1].push_back(b - 1);
    g[b - 1].push_back(a - 1);
  }
  int k = 1, p = 1;
  for (int i = 0; i < (int)g[0].size(); ++i) {
    k = mul(k, dfs(g[0][i], 0));
    p = mul(p, i + 1);
  }
  printf("%d\n", mul(n, mul(k, p)));
  return 0;
}
