#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int main() {
  int n;
  cin >> n;
  vector<long long> pw((int)2e5 + 7);
  pw[1] = 1;
  for (int i = 2; i <= (int)2e5 + 7; i++) pw[i] = (pw[i - 1] * i) % MOD;
  vector<int> cnt((int)2e5 + 7, 0);
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    cin >> x >> y;
    cnt[x]++, cnt[y]++;
  }
  long long ans = 1;
  for (int i = 1; i <= n; i++) ans = (ans * pw[cnt[i]]) % MOD;
  cout << (ans * n) % MOD;
  return 0;
}
