#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
vector<int> G[200005];
int st[200005], fat[200005];
void dfs(int v, int p) {
  st[v]++;
  for (int x : G[v]) {
    if (x == p) continue;
    dfs(x, v);
    st[v] += st[x];
  }
}
int f(int v, int p) {
  int ret = 1, child = 0;
  for (int x : G[v]) {
    if (x == p) continue;
    child++;
    ret = ((long long)ret * f(x, v)) % MOD;
  }
  return ((long long)ret * fat[child + (v != p)]) % MOD;
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  fat[0] = 1;
  for (int i = 1; i <= n; i++) fat[i] = ((long long)i * fat[i - 1]) % MOD;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, 1);
  int ans = f(1, 1);
  printf("%d\n", ((long long)ans * n) % MOD);
  return 0;
}
