#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 15;
const long long MOD = 998244353;
struct edge {
  int v, nxt;
};
int head[N], tot;
int mul[N];
int nums[N];
edge e[N << 1];
inline void init() {
  mul[0] = 1;
  for (int i = 1; i < N; i++) {
    mul[i] = (long long)mul[i - 1] * i % MOD;
  }
  tot = 0;
  memset(head, -1, sizeof(head));
}
inline void addEdge(int u, int v) {
  e[tot] = edge{v, head[u]};
  head[u] = tot++;
}
int dfs(int u, int pre) {
  nums[u] = 0;
  int ans = 1;
  for (int i = head[u]; ~i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == pre) {
      continue;
    }
    ans = (long long)ans * dfs(v, u) % MOD;
    nums[u]++;
  }
  if (pre == -1) {
    ans = (long long)ans * mul[nums[u]] % MOD;
  } else {
    ans = (long long)ans * mul[nums[u] + 1] % MOD;
  }
  return ans;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    init();
    for (int i = 1; i <= n - 1; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      addEdge(u, v);
      addEdge(v, u);
    }
    printf("%lld\n", (long long)dfs(1, -1) * n % MOD);
  }
}
