#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> adj[200100];
long long dp[200100], mod = 998244353, fa[200100];
void dfs(long long u, long long p) {
  dp[u] = fa[adj[u].size()];
  for (long long v : adj[u]) {
    if (v == p) continue;
    dfs(v, u);
    dp[u] = (dp[u] * dp[v]) % mod;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  fa[0] = 1;
  for (long long i = 1; i <= n; i++) fa[i] = (i * fa[i - 1]) % mod;
  for (long long i = 0, x, y; i < n - 1; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1, -1);
  cout << ((dp[1] * n) % mod + mod) % mod;
  return 0;
}
