#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<iomanip>
#include<math.h>
#include<bitset>
#include<cassert>
#include<random>
#include<time.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<int,int>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

/* --------------------------------------- */

#define MAX_N 220
long long extgcd(long long a, long long b, long long& x, long long& y) {
	long long d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	} else {
		x = 1; y = 0;
	}
	return d;
}
long long mod_inverse(long long a, long long m) {
	long long x, y;
	if(extgcd(a, m, x, y) == 1) return (m + x % m) % m;
	else return -1;
}
vector<long long> fact(MAX_N+1, INF);
long long mod_fact(long long n, long long& e) {
	if(fact[0] == INF) {
		fact[0]=1;
		if(MAX_N != 0) fact[1]=1;
		for(ll i = 2; i <= MAX_N; ++i) {
			fact[i] = (fact[i-1] * i) % MOD;
		}
	}
	e = 0;
	if(n == 0) return 1;
	long long res = mod_fact(n / MOD, e);
	e += n / MOD;
	if((n / MOD) % 2 != 0) return (res * (MOD - fact[n % MOD])) % MOD;
	return (res * fact[n % MOD]) % MOD;
}
// return nCk
long long mod_comb(long long n, long long k) {
	if(n < 0 || k < 0 || n < k) return 0;
	long long e1, e2, e3;
	long long a1 = mod_fact(n, e1), a2 = mod_fact(k, e2), a3 = mod_fact(n - k, e3);
	if(e1 > e2 + e3) return 0;
	return (a1 * mod_inverse((a2 * a3) % MOD, MOD)) % MOD;
}

ll n;
ll root = -1;
vector<vector<ll>> childs;
vector<ll> subtree;
vector<bool> isChild;
vector<vector<ll>> dp;

ll calc_subtree(ll node) {
	ll ret = 1;
	REP(i, childs[node].size()) {
		ret += calc_subtree(childs[node][i]);
	}
	return subtree[node] = ret;
}

void dfs(ll node) {
	if(childs[node].empty()) {
		dp[node][1] = 1;
		return;
	}
	REP(i, childs[node].size()) dfs(childs[node][i]);
	vector<ll> tmp(n + 1, 0);
	REP(i, n + 1) tmp[i] = dp[childs[node][0]][i];
	ll sumNode = subtree[childs[node][0]];
	FOR(i ,1 ,childs[node].size()) {
		ll r = childs[node][i];
		vector<ll> ntmp(n + 1, 0);
		FOR(j, 1, sumNode + 1) FOR(k, 1, subtree[r] + 1) {
			FOR(l, max(j, k), j + k + 1) {
				ntmp[l] += ((tmp[j] * dp[r][k]) % MOD)
				* ((mod_comb(l, j + k - l) * mod_comb(2 * l - (j + k), l - k)) % MOD);
				ntmp[l] %= MOD;
			}
		}
		tmp = ntmp;
		sumNode += subtree[r];
	}
	FOR(i, 1, n + 1) dp[node][i] = tmp[i - 1];
	return;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n;
	childs.resize(n);
	subtree.resize(n);
	isChild.assign(n, false);
	dp.assign(n, vector<ll>(n + 1, 0));
	REP (i, n - 1) {
		ll a, b;
		cin >> a >> b;
		childs[a].pb(b);
		isChild[b] = true;
	}
	REP(i, n) if(!isChild[i]) root = i;
	calc_subtree(root);
	dfs(root);
	ll ans = 0;
	REP(i, n + 1) ans += dp[root][i];
	cout << (ans % MOD + MOD) % MOD << endl;
	return 0;
}

/* --------------------------------------- */



Measured memory_bytes: 3548