#include <bits/stdc++.h>
using namespace std;
const int N = 998244353;
long long n, u, v, gt[200010], f[200010], s[200010];
vector<int> x[200010];
void dfs(int i, int cha) {
  f[i] = 1;
  for (int z : x[i]) {
    if (z != cha) {
      dfs(z, i);
      f[i] = (f[i] * f[z]) % N;
      s[i]++;
    }
  }
  f[i] = f[i] * gt[s[i] + (i != 1)] % N;
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    x[u].push_back(v);
    x[v].push_back(u);
  }
  gt[0] = gt[1] = 1;
  for (int i = 2; i <= n; i++) gt[i] = (gt[i - 1] * i) % N;
  dfs(1, 1);
  cout << f[1] * n % N;
}
