#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long mod = 998244353;
long long n, A[maxn], sz[maxn];
void input() {
  cin >> n;
  A[1] = 1;
  for (int i = 2; i < maxn; ++i) {
    A[i] = (A[i - 1] * 1LL * i) % mod;
  }
  for (long long a, b, i = 1; i < n; ++i) {
    cin >> a >> b;
    sz[a]++, sz[b]++;
  }
}
void work() {
  long long ans = 1;
  for (int i = 1; i <= n; ++i) {
    ans = (ans * A[sz[i]]) % mod;
  }
  ans = (ans * n) % mod;
  cout << ans << endl;
  return;
}
signed main() {
  input();
  work();
  return 0;
}
