#include using namespace std; const int MOD = 1000000007; long long pow(long long x, long long n, long long mod) { long long ans = 1; while (n) { if (n % 2) ans *= x; x *= x; x %= mod; ans %= mod; n >>= 1; } return ans; } vector factorial(2, 1); long long comb(long long n, long long k, long long p) { if (n < k || n <= 0 || k < 0) return 0; while (factorial.size() <= n) { long long i = factorial.size(); factorial.push_back(i * factorial[i - 1] % p); } return ((factorial[n] * pow(factorial[k], p - 2, p)) % p) * pow(factorial[n - k], p - 2, p) % p; } long long Narayana(const long long& n, const long long& k, const long long& p) { return comb(n, k, p) * comb(n, k - 1, p) % p * pow(n, MOD - 2, p) % p; } vector> adj; int leaf_count = 0; void dfs(int x, int prev) { cerr << x << ' ' << prev << endl; bool is_leaf = true; for (auto next : adj[x]) { if (next != prev) { dfs(next, x); is_leaf = false; } } leaf_count += is_leaf; } int main() { int N; cin >> N; adj.resize(N); for (int i = 0; i < N - 1; i++) { int a, b; cin >> a >> b; a--; b--; adj[a].push_back(b); adj[b].push_back(a); } dfs(0, -1); cout << Narayana(N - 1, leaf_count, MOD) << endl; }