#include <bits/stdc++.h>
using namespace std;
const long long Mod = 998244353;
long long n;
long long Ans = 1, a[200100], fact[200100];
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    a[x]++;
    a[y]++;
  }
  fact[1] = 1;
  for (int i = 2; i <= n; i++) fact[i] = (fact[i - 1] * i) % Mod;
  for (int i = 1; i <= n; i++) {
    Ans = (Ans * fact[a[i]]) % Mod;
  }
  cout << (Ans * n) % Mod;
  return 0;
}
