#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 200002;
long long mod = 998244353;
vector<int> adj[N];
long long fact[N + 2];
bool visited[N];
long long dfs(int node) {
  long long ans = 1;
  visited[node] = true;
  for (int child : adj[node]) {
    if (!visited[child]) {
      long long ans1 = (adj[child].size() * dfs(child)) % mod;
      ans = (ans1 * ans) % mod;
    }
  }
  if (node == 1) {
    ans = (ans * fact[adj[node].size()]) % mod;
  } else {
    ans = (ans * fact[adj[node].size() - 1]) % mod;
  }
  ans = ans % mod;
  return ans;
}
int main() {
  memset(visited, false, sizeof visited);
  scanf("%d", &n);
  fact[0] = 1;
  fact[1] = 1;
  for (int i = 2; i < N; i++) fact[i] = (fact[i - 1] * i) % mod;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long ans = (n * dfs(1)) % mod;
  cout << ans << endl;
  return 0;
}
