#include <bits/stdc++.h>
using namespace std;
const long long maxn = 200005;
const long long inf = 1ll << 60;
const long long mod = 998244353;
struct Edge {
  long long to, next;
} a[maxn * 2];
long long cnt;
long long h[maxn];
long long f[maxn];
long long fact[maxn];
void add(long long x, long long y) {
  a[++cnt] = (Edge){y, h[x]};
  h[x] = cnt;
}
void dfs(long long x, long long fa) {
  f[x] = 1;
  long long s = 0;
  for (long long i = h[x]; i; i = a[i].next) {
    if (a[i].to == fa) {
      continue;
    }
    dfs(a[i].to, x);
    s++;
    f[x] = 1ll * f[x] * f[a[i].to] % mod;
  }
  if (x == 1) {
    f[x] = 1ll * f[x] * fact[s] % mod % mod;
    return;
  }
  f[x] = 1ll * f[x] * fact[s + 1] % mod % mod;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = 1ll * fact[i - 1] * i % mod;
  }
  for (long long i = 1; i <= n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    add(x, y);
    add(y, x);
  }
  dfs(1, 0);
  cout << (1ll * f[1] * n % mod);
}
