#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const long long mod = 998244353;
vector<long long> grafo[MAXN];
long long f[MAXN];
long long fat(long long x) {
  if (x == 0) return 1;
  if (f[x] != -1) return f[x];
  return f[x] = (x * (fat(x - 1))) % mod;
}
long long dfs(long long x, long long p) {
  long long r = 1;
  long long n;
  n = grafo[x].size();
  for (long long i = 0; i < grafo[x].size(); i++) {
    long long at = grafo[x][i];
    if (at == p) continue;
    r *= dfs(at, x), r %= mod;
  }
  r *= fat(n), r %= mod;
  return r;
}
signed main() {
  memset(f, -1, sizeof f);
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    grafo[x].push_back(y), grafo[y].push_back(x);
  }
  cout << (n * dfs(1, 1)) % mod << endl;
}
