#include <bits/stdc++.h>
using namespace std;
int n, m, t;
int st, ed;
vector<int> adj[200005];
bool visit[200005];
long long fac[200005];
long long ans;
void dfs(int a) {
  int cnt = 0;
  visit[a] = true;
  for (int i = 0; i < adj[a].size(); i++) {
    if (visit[adj[a][i]] == false) {
      dfs(adj[a][i]);
      cnt++;
    }
  }
  if (a != 1) {
    ans = (long long)ans * fac[cnt + 1];
  } else {
    ans = (long long)ans * fac[cnt];
  }
  ans = ans % 998244353;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &st, &ed);
    adj[st].push_back(ed);
    adj[ed].push_back(st);
  }
  fac[1] = 1;
  fac[0] = 1;
  for (int i = 2; i <= 200000; i++) {
    fac[i] = (long long)fac[i - 1] * i;
    fac[i] = fac[i] % 998244353;
  }
  ans = 1;
  dfs(1);
  ans = ans * n;
  ans = ans % 998244353;
  printf("%lld\n", ans);
  return 0;
}
