#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[200000], ch[200000];
bool vo[200000] = {false};
long long fac[200001];
long long f(int rt) {
  long long res = fac[ch[rt].size() + 1];
  for (int& oc : ch[rt]) {
    res *= f(oc);
    res %= 998244353;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  stack<int> stk;
  stk.push(0);
  vo[0] = true;
  while (stk.size()) {
    int c = stk.top();
    stk.pop();
    for (int& nb : adj[c]) {
      if (!vo[nb]) {
        vo[nb] = true;
        ch[c].push_back(nb);
        stk.push(nb);
      }
    }
  }
  fac[0] = 1;
  for (long long i = 1; i <= 200000; i++) {
    fac[i] = fac[i - 1] * i % 998244353;
  }
  if (ch[0].size() == 0) {
    cout << "1\n";
    return 0;
  }
  int rt2 = ch[0].back();
  ch[0].pop_back();
  cout << ((f(0) * f(rt2) % 998244353) * n % 998244353) << '\n';
}
