#include <bits/stdc++.h>
using namespace std;
int n;
const int mod = 998244353;
long long fac[200015];
vector<int> e[200015];
long long dfs(int u, int fa) {
  long long res = 1;
  for (auto v : e[u])
    if (v != fa) res = (res * dfs(v, u) % mod) % mod;
  res = (res * fac[(int)e[u].size()]) % mod;
  return res % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = (fac[i - 1] * i) % mod;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  cout << (1ll * n * dfs(1, -1)) % mod << endl;
  return 0;
}
