#include <bits/stdc++.h>
using namespace std;
const long long int p = 998244353;
vector<vector<int>> tree;
vector<long long int> rec(200001);
long long int search(int cur, int par = 0) {
  long long int base = rec[tree[cur].size() - 1] * (tree[cur].size()) % p;
  for (auto e : tree[cur]) {
    if (e != par) {
      (base *= search(e, cur)) %= p;
    }
  }
  return base;
}
int main(void) {
  int n;
  scanf("%d", &n);
  tree.resize(n + 1);
  rec[0] = 1;
  for (int i = 1; i <= n; i++) {
    rec[i] = rec[i - 1] * i % p;
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  long long int ans = search(1);
  cout << ans * n % p << endl;
  return 0;
}
