#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long mod = 998244353;
vector<int> e[maxn];
long long ans = 1, fac[maxn];
int n;
void dfs(int u, int f, int d) {
  int sz = 0;
  for (int v : e[u]) {
    if (v == f) continue;
    dfs(v, u, d + 1);
    sz++;
  }
  if (d == 1)
    ans = ans * fac[sz] % mod;
  else if (sz > 0)
    ans = ans * fac[sz + 1] % mod;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  fac[0] = 1;
  for (int i = 1; i < maxn; i++) fac[i] = fac[i - 1] * i % mod;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, -1, 1);
  ans = ans * n % mod;
  cout << ans << '\n';
  return 0;
}
