#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
vector<int> e[200003];
int a[200003];
long long sum = 1;
long long dfs(int i, int pa) {
  for (int j = 0; j < e[i].size(); j++) {
    if (e[i][j] != pa) {
      a[i]++;
      a[e[i][j]]++;
      sum = sum * a[i] % M;
      dfs(e[i][j], i);
    }
  }
  return sum;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  long long ans = dfs(1, -1) * n % M;
  cout << ans;
}
