#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> E[200005];
long long int fact[200005];
int x;
int y;
int main() {
  cin >> N;
  fact[1] = 1;
  for (long long int i = 2; i < 200005; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 998244353L;
  }
  for (int i = 1; i < N; i++) {
    cin >> x >> y;
    x -= 1;
    y -= 1;
    E[x].push_back(y);
    E[y].push_back(x);
  }
  long long int answer = N;
  for (int i = 0; i < N; i++) {
    answer *= fact[E[i].size()];
    answer %= 998244353L;
  }
  cout << answer << endl;
}
