#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int MOD = 998244353;
long long fac[MAXN];
struct Edge {
  int to, next;
} edge[MAXN * 2];
int head[MAXN], tot;
void AddEdge(int s, int t) {
  edge[tot].to = t;
  edge[tot].next = head[s];
  head[s] = tot++;
  edge[tot].to = s;
  edge[tot].next = head[t];
  head[t] = tot++;
}
int visit[MAXN];
void init() {
  memset(head, -1, sizeof(head));
  memset(visit, 0, sizeof(visit));
  tot = 0;
}
long long DFS(int u) {
  visit[u] = 1;
  long long ret = 1;
  int cnt = 1;
  if (u == 1) cnt = 0;
  for (int e = head[u]; e != -1; e = edge[e].next) {
    int v = edge[e].to;
    if (!visit[v]) {
      cnt++;
      ret = (ret * DFS(v)) % MOD;
    }
  }
  ret = (ret * fac[cnt]) % MOD;
  return ret;
}
int main() {
  int n;
  cin >> n;
  long long fa = 1;
  for (int i = 1; i < MAXN; i++) {
    fa = (fa * i) % MOD;
    fac[i] = fa;
  }
  init();
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    AddEdge(u, v);
  }
  cout << (DFS(1) * n) % MOD << endl;
  return 0;
}
