#include <bits/stdc++.h>
using namespace std;
const long long Mod = 998244353;
long long Fact[200200];
int n, a, b;
vector<int> G[200200];
long long DFS(int u, int p) {
  long long Cur = Fact[G[u].size()];
  for (auto i : G[u])
    if (i != p) Cur = (Cur % Mod * DFS(i, u) % Mod) % Mod;
  return Cur % Mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Fact[0] = 1;
  for (int i = 1; i <= 200000; i++)
    Fact[i] = (Fact[i - 1] % Mod * i % Mod) % Mod;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  long long Ans = DFS(1, -1) % Mod;
  Ans = (Ans % Mod * n % Mod) % Mod;
  cout << Ans % Mod << '\n';
  return 0;
}
