#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200005];
bool vis[200005] = {0};
long long fact[200005];
long long dfs(int n) {
  vis[n] = true;
  long long ans = 1;
  for (int c : adj[n]) {
    if (vis[c]) continue;
    ans = ans * dfs(c) % 998244353;
  }
  int e = adj[n].size();
  ans = ans * fact[e] % 998244353;
  return ans;
}
int main() {
  int N, a, b;
  cin >> N;
  for (int i = 0; i < N - 1; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  fact[0] = 1;
  for (int i = 1; i < 200005; i++) {
    fact[i] = i * fact[i - 1];
    fact[i] %= 998244353;
  }
  cout << (N * dfs(1) % 998244353) << endl;
}
