#include <bits/stdc++.h>
using namespace std;
int main() {
  iostream::sync_with_stdio(false);
  ios::sync_with_stdio(false);
  long long i, u, v;
  const long long mod = 998244353;
  long long n, ans, *d;
  cin >> n;
  d = new long long[n + 1];
  memset(d, 0, (n + 1) * sizeof(long long));
  ans = n;
  for (i = 1; i < n; i++) {
    cin >> u >> v;
    long long tmp1, tmp2, tmp3;
    tmp1 = ans;
    d[u]++;
    tmp2 = d[u];
    d[v]++;
    tmp3 = d[v];
    ans = (long long)tmp1 * tmp2 % mod * (tmp3) % mod;
  }
  cout << ans << endl;
  delete[] d;
  return 0;
}
