#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const int mod = 998244353;
int n;
vector<int> g[maxn];
long long pre[maxn];
pair<long long, long long> dfs(int u, int f) {
  long long cnt = 1;
  long long ans = 1;
  long long res = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == f) continue;
    res++;
    pair<long long, long long> x = dfs(v, u);
    ans = ans * x.first % mod;
    cnt += x.second;
  }
  pair<long long, long long> q;
  if (!f) {
    q = {pre[res - 1] * ans % mod, cnt};
  } else
    q = {pre[res] * ans % mod, cnt};
  return q;
}
int main() {
  scanf("%d", &n);
  pre[0] = 1ll;
  for (long long i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] * i % mod;
  }
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  printf("%lld\n", dfs(1, 0).first * n % mod);
}
