#include <bits/stdc++.h>
using namespace std;
using cd = complex<double>;
long long mod = 998244353, c[200005], p[200005], n;
vector<long long> edge[200005];
void dfs(long long u, long long fa) {
  c[u] = 1;
  long long t = 0;
  for (auto v : edge[u]) {
    if (v == fa) continue;
    dfs(v, u);
    t++;
    c[u] *= c[v];
    c[u] %= mod;
  }
  if (u == 1) {
    c[u] *= p[t];
    c[u] %= mod;
    c[u] *= n;
    c[u] %= mod;
  } else {
    c[u] *= p[t + 1];
    c[u] %= mod;
  }
}
int main() {
  cin >> n;
  p[0] = 1;
  for (long long i = 1; i <= n; i++) {
    p[i] = p[i - 1] * i;
    p[i] %= mod;
  }
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs(1, 0);
  cout << c[1] << endl;
}
