#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long mod = 998244353;
int n;
vector<int> a[N];
long long f[N], d[N];
void dfs(int u, int p) {
  d[u] = f[(long long)a[u].size()];
  for (int v : a[u]) {
    if (v != p) {
      dfs(v, u);
      d[u] = d[u] * d[v] % mod;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  f[1] = 1;
  f[0] = 1;
  for (long long i = 2; i <= n; ++i) {
    f[i] = f[i - 1] * i % mod;
  }
  dfs(1, 0);
  cout << d[1] * n % mod;
  return 0;
}
