#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
long long int t, n, m, a[1000005] = {0}, fact[1000005] = {0},
                       inv[1000005] = {0};
vector<long long int> v[300005];
long long int F(long long int x, long long int y) {
  if (y > x) return 0;
  long long int ans = (inv[y] * inv[x - y]) % mod;
  ans = (ans * fact[x]) % mod;
  return ans;
}
long long int binexpo(long long int a, long long int b, long long int m) {
  a %= m;
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
void dfs(long long int x, long long int pp) {
  if (v[x].size() == 1 && v[x][0] == pp) {
    a[x] = 1;
    return;
  }
  long long int i, prod = 1, cc = 0;
  for (i = 0; i < v[x].size(); i++) {
    if (v[x][i] == pp) continue;
    cc++;
    dfs(v[x][i], x);
    prod *= a[v[x][i]];
    prod %= mod;
  }
  if (x == 1)
    a[x] = (fact[cc] * prod) % mod;
  else {
    for (i = 0; i <= cc; i++)
      a[x] = (a[x] + (((fact[i] * fact[cc - i]) % mod) * F(cc, i)) % mod) % mod;
    a[x] = (a[x] * prod) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, x, y;
  cin >> n;
  fact[0] = 1;
  inv[0] = binexpo(1, mod - 2, mod);
  for (i = 1; i < 1000005; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv[i] = binexpo(fact[i], mod - 2, mod);
  }
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, 1);
  cout << (a[1] * n) % mod;
  cerr << '\n'
       << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n";
  return 0;
}
