#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long p = 998244353;
long long fac[N], inv[N];
inline long long mult(long long a, long long b) {
  return ((a * b) % p + p) % p;
}
inline long long add(long long a, long long b) { return ((a + b) % p + p) % p; }
inline long long sub(long long a, long long b) { return ((a - b) % p + p) % p; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = mult(res, a);
    b >>= 1;
    a = mult(a, a);
  }
  return res;
}
inline long long divi(long long a, long long b) {
  return mult(a, binpow(b, p - 2));
}
long long c(int a, int b) {
  if (b < 0 || a < b) return 0;
  return mult(mult(fac[a], inv[b]), inv[a - b]);
}
void precalc() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = mult(fac[i - 1], i);
  inv[N - 1] = binpow(fac[N - 1], p - 2);
  for (int i = N - 1; i >= 1; i--) inv[i - 1] = mult(inv[i], i);
}
vector<int> g[N];
bool used[N];
long long dfs(int v) {
  used[v] = 1;
  long long res = 1;
  res = mult(res, fac[g[v].size()]);
  for (int u : g[v]) {
    if (!used[u]) res = mult(res, dfs(u));
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  precalc();
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long ans = mult(n, dfs(1));
  cout << ans << "\n";
  return 0;
}
