#include <bits/stdc++.h>
using namespace std;
int main() {
  int modulo = 998244353;
  int fac[200010];
  fac[0] = 1;
  fac[1] = 1;
  for (auto(i) = (2); (i) < (200010); (i)++) {
    fac[i] = (((long long)fac[i - 1]) * i) % modulo;
  }
  1;
  int n;
  cin >> n;
  vector<vector<int>> tree(n);
  for (auto(i) = (0); (i) < (n - 1); (i)++) {
    int a, b;
    cin >> a >> b;
    tree[a - 1].push_back(b - 1);
    tree[b - 1].push_back(a - 1);
  }
  1;
  int first_edges = tree[0].size();
  long long sum = (1ll * fac[first_edges]) % modulo;
  sum = (sum * n) % modulo;
  queue<pair<int, int>> todo;
  for (auto &(node) : (tree[0])) {
    todo.push({node, 0});
  }
  1;
  while (!todo.empty()) {
    int node = todo.front().first;
    int root = todo.front().second;
    todo.pop();
    for (auto &(next) : (tree[node])) {
      if (next != root) {
        todo.push({next, node});
      }
    }
    sum = (sum * fac[tree[node].size()]) % modulo;
  }
  cout << sum << endl;
}
