#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
vector<long long> G[200005];
long long dp[200005], w[200005], J[200005];
void dfs(long long u, long long f) {
  dp[u] = 1, w[u] = 1;
  for (long long i : G[u])
    if (i != f) {
      dfs(i, u), w[u] += w[i];
      dp[u] = dp[u] * dp[i] % MOD * (long long)(G[i].size()) % MOD;
    }
  if (u != 1)
    dp[u] = dp[u] * J[G[u].size() - 1] % MOD;
  else
    dp[u] = dp[u] * J[G[u].size()] % MOD;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, a, b;
  cin >> n, J[0] = 1;
  for (int i = 1; i < n; ++i)
    cin >> a >> b, G[a].push_back(b), G[b].push_back(a),
        J[i] = J[i - 1] * i % MOD;
  dfs(1, 1);
  cout << dp[1] * n % MOD << "\n";
}
