#include <vector>
#include <iostream>
using namespace std;
int n, a, b, ord[209]; unsigned comb[209][209][209], dp[209][209], ndp[209], mod = 1000000007; vector<int> g[209];
int calc(int pos, int pre) {
	int sub = 1; dp[pos][1] = 1;
	for (int i : g[pos]) {
		if (i == pre) continue;
		int w = calc(i, pos);
		fill(ndp + 1, ndp + sub + w + 1, 0);
		for (int j = 1; j <= sub; j++) {
			for (int k = 1; k <= w; k++) {
				for (int l = 0; l <= j - 1 && l <= k; l++) {
					ndp[j + k - l] = (ndp[j + k - l] + 1LL * dp[pos][j] * dp[i][k] % mod * comb[j - 1][k][l]) % mod;
				}
			}
		}
		sub += w;
		for (int j = 1; j <= sub; j++) dp[pos][j] = ndp[j];
	}
	return sub;
}
int main() {
	cin >> n;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		g[a].push_back(b);
		ord[b]++;
	}
	comb[0][0][0] = 1;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; i + j <= n; j++) {
			for (int k = 0; k <= i && k <= j; k++) {
				if (i >= 1) comb[i][j][k] = comb[i - 1][j][k];
				if (j >= 1) comb[i][j][k] += comb[i][j - 1][k];
				if (i >= 1 && j >= 1 && k >= 1) comb[i][j][k] += comb[i - 1][j - 1][k - 1];
				while (comb[i][j][k] >= mod) comb[i][j][k] -= mod;
			}
		}
	}
	int ret = 0;
	for (int i = 0; i < n; i++) {
		if (ord[i] == 0) {
			calc(i, -1);
			for (int j = 1; j <= n; j++) ret = (ret + dp[i][j]) % mod;
		}
	}
	cout << ret << endl;
	return 0;
}
