#include <bits/stdc++.h>
using namespace std;

namespace fft {
struct C {
  double x, y;
  C(double _x = 0, double _y = 0) : x(_x), y(_y) {}
};
C operator+(C l, C r) { return {l.x + r.x, l.y + r.y}; }
C operator-(C l, C r) { return {l.x - r.x, l.y - r.y}; }
C operator*(C l, C r) { return {l.x * r.x - l.y * r.y, l.x * r.y + l.y * r.x}; }
C operator~(C a) { return {a.x, -a.y}; }
vector<C> w{1};
void ensure(int n) {
  for (int m = w.size(); m < n; m *= 2) {
    C dw{cos(acos(0) / m), sin(acos(0) / m)};
    w.resize(2 * m);
    for (int i = 0; i < m; ++i) w[m + i] = w[i] * dw;
  }
}
void fft(vector<C>& a, int n, bool inverse) {
  assert((n & (n - 1)) == 0);
  ensure(n);
  if (not inverse) {
    for (int m = n; m >>= 1; ) {
      for (int s = 0, k = 0; s < n; s += 2 * m, ++k) {
        for (int i = s, j = s + m; i < s + m; ++i, ++j) {
          C x = a[i], y = a[j] * w[k];
          a[i] = x + y, a[j] = x - y;
        }
      }
    }
  } else {
    for (int m = 1; m < n; m *= 2) {
      for (int s = 0, k = 0; s < n; s += 2 * m, ++k) {
        for (int i = s, j = s + m; i < s + m; ++i, ++j) {
          C x = a[i], y = a[j];
          a[i] = x + y, a[j] = (x - y) * ~w[k];
        }
      }
    }
    double inv = 1.0 / n;
    for (auto&& e : a) e.x *= inv, e.y *= inv;
  }
}
void real_fft(vector<C>& a) {
  if (a.size() < 2) return;
  assert(a.size() % 2 == 0);
  int n = a.size() / 2;
  for (int i = 0; i < n; ++i) a[i] = {a[2 * i].x, a[2 * i + 1].x};
  fft(a, n, false);
  for (int s = n; s >>= 1; ) for (int i = s, j = 2 * s; j-- > s; ++i) {
    C wa((1 + w[i].y) / 2, -w[i].x / 2), wb((1 - w[i].y) / 2, w[i].x / 2);
    a[2 * i] = a[i] * wa + ~a[j] * wb, a[2 * j + 1] = ~a[2 * i];
  }
  a[1] = a[0].x - a[0].y, a[0] = a[0].x + a[0].y;
}
void real_ifft(vector<C>& a) {
  if (a.size() < 2) return;
  assert(a.size() % 2 == 0);
  int n = a.size() / 2;
  for (int i = 0; i < n; ++i) {
    C wa((1 + w[i].y) / 2, w[i].x / 2), wb((1 - w[i].y) / 2, -w[i].x / 2);
    a[i] = a[2 * i] * wa + a[2 * i + 1] * wb;
  }
  fft(a, n, true);
  for (int i = n; i--; ) a[2 * i].x = a[i].x, a[2 * i + 1].x = a[i].y;
}
} // namespace fft

template <class T, class Op = multiplies<T>>
T power(T a, long long n, Op op = multiplies<T>(), T e = {1}) {
  assert(n >= 0);
  while (n) {
    if (n & 1) e = op(e, a);
    if (n >>= 1) a = op(a, a);
  }
  return e;
}

template <unsigned M> struct modular {
  using m = modular;
  unsigned v;
  modular(long long a = 0) : v((a %= M) < 0 ? a + M : a) {}
  m operator-() const { return m() -= *this; }
  m& operator+=(m r) { if ((v += r.v) >= M) v -= M; return *this; }
  m& operator-=(m r) { if (v < r.v) v += M; v -= r.v; return *this; }
  m& operator*=(m r) { v = (uint64_t)v * r.v % M; return *this; }
  m& operator/=(m r) { return *this *= power(r, M - 2); }
  friend m operator+(m l, m r) { return l += r; }
  friend m operator-(m l, m r) { return l -= r; }
  friend m operator*(m l, m r) { return l *= r; }
  friend m operator/(m l, m r) { return l /= r; }
  friend bool operator==(m l, m r) { return l.v == r.v; }
  friend string to_string(m a) { return to_string(a.v); }
};

constexpr long long mod = 1e9 + 7;
using mint = modular<mod>;

struct dual_vec {
  array<vector<fft::C>, 2> v;
  void resize(int sz) { for (auto&& e : v) e.resize(sz); }
};
dual_vec mfft(const vector<mint>& a, int sz) {
  dual_vec fa;
  fa.resize(sz);
  for (int i = 0; i < min<int>(a.size(), sz); ++i)
    fa.v[0][i] = a[i].v & 0x7fff, fa.v[1][i] = a[i].v >> 15;
  fft::real_fft(fa.v[0]), fft::real_fft(fa.v[1]);
  return fa;
}
auto operator*(const dual_vec& l, const dual_vec& r) {
  array<vector<fft::C>, 3> res;
  for (auto&& e : res) e.resize(l.v[0].size());
  for (int p : {0, 1}) for (int q : {0, 1})
    for (int i = 0; i < (int)l.v[0].size(); ++i)
      res[p + q][i] = res[p + q][i] + l.v[p][i] * r.v[q][i];
  return res;
}
vector<mint> ifft(array<vector<fft::C>, 3> fa, int n) {
  vector<mint> res(n);
  for (int p = 0; p < 3; ++p) {
    fft::real_ifft(fa[p]);
    auto base = power(mint(1 << 15), p);
    for (int i = 0; i < n; ++i) res[i] += round(fa[p][i].x) * base;
  }
  return res;
}

vector<mint> operator*(const vector<mint>& l, const vector<mint>& r) {
  if (l.empty() or r.empty()) return {};
  int n = l.size(), m = r.size(), sz = 1 << __lg(2 * (n + m - 1) - 1);
  if (min(n, m) < 30) {
    vector<long long> res(n + m - 1);
    for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j)
      res[i + j] += (l[i] * r[j]).v;
    return {begin(res), end(res)};
  }
  return ifft(mfft(l, sz) * mfft(r, sz), n + m - 1);
}

vector<mint> fact, inv_fact, minv;
void prepare(int n) {
  fact.resize(n + 1), inv_fact.resize(n + 1), minv.resize(n + 1);
  for (int i = 0; i <= n; ++i) fact[i] = i ? i * fact[i - 1] : 1;
  inv_fact[n] = power(fact[n], mod - 2);
  for (int i = n; i; --i) inv_fact[i - 1] = i * inv_fact[i];
  for (int i = 1; i <= n; ++i) minv[i] = inv_fact[i] * fact[i - 1];
}
mint binom(int n, int k) {
  if (k < 0 or k > n) return 0;
  return fact[n] * inv_fact[k] * inv_fact[n - k];
}
template<> mint& mint::operator/=(mint r) {
  return *this *= r.v < minv.size() ? minv[r.v] : power(r, mod - 2);
}

vector<mint> merge(const vector<mint>& l, int n, const vector<mint>& r, int m) {
  vector<mint> res((n + m) / 2 + 1);
  for (int k = 0; k <= min(n, m); ++k) {
    auto a = l, b = r;
    for (int i = n & 1; i <= n; i += 2) {
      a[i >> 1] *= binom(i, k);
    }
    for (int j = m & 1; j <= m; j += 2) {
      b[j >> 1] *= binom(j, k);
    }
    if (m % 2 == 0) {
      b[0] = 0;
    }
    auto c = a * b;
    for (int x = (n + m) & 1; x + 2 * k <= n + m; x += 2) {
      int idx = (x + 2 * k - (n & 1) - (m & 1)) >> 1;
      res[x >> 1] += (idx >= 0 ? c[idx] : 0) * fact[k];
    }
  }
  return res;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<int>> g(n);
  for (int _ = n - 1; _--; ) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  prepare(n);
  vector<vector<mint>> dp(n);
  vector<int> sz(n);
  auto dfs = [&](auto&& self, int v, int p) -> void {
    dp[v] = {1};
    sz[v] = 1;
    for (int u : g[v]) {
      if (u != p) {
        self(self, u, v);
        dp[v] = merge(dp[v], sz[v], dp[u], sz[u]);
        sz[v] += sz[u];
      }
    }
  };
  dfs(dfs, 0, -1);
  cout << dp[0][0].v << '\n';
}


Measured memory_bytes: 18752