#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long n, m, x, y, z;
vector<long long> edges[400000];
long long subtree[400000];
long long fct[400000];
long long inv[400000];
long long bigmod(long long n, long long k, long long mod) {
  if (k == 0) return 1;
  long long re = bigmod(n, k / 2, mod);
  re = (re * re) % mod;
  if (k % 2) re = (re * n) % mod;
  return re;
}
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  long long tmp = fct[n];
  tmp = (tmp * inv[r]) % mod;
  tmp = (tmp * inv[n - r]) % mod;
  return tmp;
}
long long dfs(long long pos, long long par) {
  subtree[pos] = 1;
  long long ans = 1;
  long long chld = 0;
  for (long long to : edges[pos]) {
    if (to == par) continue;
    long long xx = dfs(to, pos);
    subtree[pos] += subtree[to];
    ans = (ans * xx) % mod;
    chld++;
  }
  if (pos == 1) {
    ans = (ans * subtree[pos]) % mod;
    ans = (ans * fct[chld]) % mod;
  } else {
    long long tmp = 0;
    for (long long i = 0; i <= chld; i++) {
      long long xx = (fct[i] * fct[chld - i]) % mod;
      xx = (xx * ncr(chld, i));
      tmp = (tmp + xx) % mod;
    }
    ans = (ans * tmp) % mod;
  }
  return ans;
}
int main() {
  fct[0] = inv[0] = 1;
  for (long long i = 1; i <= 300000; i++) fct[i] = (fct[i - 1] * i) % mod;
  for (long long i = 1; i <= 300000; i++) inv[i] = bigmod(fct[i], mod - 2, mod);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    scanf("%lld %lld", &x, &y);
    edges[x].push_back(y);
    edges[y].push_back(x);
  }
  long long ans = dfs(1, 0);
  cout << ans << endl;
  return 0;
}
