﻿#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,fma,tune=native"

#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <deque>
#include <functional>
#include <set>
#include <map>
#include <random>
#include <cstdlib>
#include <memory>   
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <time.h>
#include <stack>
#include <queue>
#include <complex>


	using namespace std;
using ll = long long;
using ul = unsigned long long;
using ld = long double;

template<typename T>
void print(T h, string s = " ") { for (auto ijkl : h) cout << ijkl << s; cout << "\n"; }


const long long INF = 1e18;
#define vll vector <ll>
#define ve vector
#define sll set <ll>
#define pll pair <ll, ll>
#define printvpll(h) for (auto ijkl : h) cerr << ijkl.ft << ":" << ijkl.sd << " "; cerr << "\n";
#define scan(h, n) for (int ijkl = 0; ijkl < n; ++ijkl) cin >> h[ijkl]
#define pow2(n) (n)    *    (n)
#define pow3(n) (n) * (n) * (n)
#define all(x) (x).begin(), (x).end()
#define MOD ll(1e9 + 7)
#define MOD2 ll(998244353)
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ft first
#define sd second
#define look1(x)          cerr << #x << ": " << x << "\n";
#define look2(x, y)       cerr << #x << ": " << x << " | " << #y << ": " << y << "\n";
#define look3(x, y, z)    cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << "\n";
#define look4(a, b, c, d) cerr << #a << ":" << a << " | " << #b << ":" << b << " | " << #c << ":" << c << " | " << #d << ":" << d << "\n";

ll pown(ll n, ll cnt, ll mod = INT64_MAX) {
	return cnt == 0 ? 1 % mod : (cnt % 2 ? pown(n * n % mod, cnt / 2, mod) * n % mod : pown(n * n % mod, cnt / 2, mod) % mod);
}

string alph = "0123456789abcdefghijklmnopqrstuvwxyz";

ve <vll> g;
ve<map<ll, ll> > h;
ll ans = 0;
vll put;
ll n;
ve <ve <ll>> dp;


ll dfscnt(ll v, ll p=-1) {
	ll cnt = 1;
	for (auto u : g[v]) {
		if (u != p) {
			h[v][u] = dfscnt(u, v);
			cnt += h[v][u];
		}
	}
	if (p + 1) {
		h[v][p] = g.size() - cnt;
	}
	return cnt;
}

void getans(ll v, ll start, ll p=-1) {
	put.pb(v);
	if (start > v) {
		ll ver = 0;
		ver += pown(n, MOD - 2, MOD) * (n - h[start][put[1]]) % MOD;
		for (int i = 1; i < (ll)put.size() - 1; ++i) {
			ver += dp[i][put.size() - 1 - i] * (n - h[put[i]][put[i - 1]] - h[put[i]][put[i + 1]]) % MOD * pown(n, MOD - 2, MOD) % MOD;
			ver %= MOD;
		}
		//look2(start, v);
		//look1(ver);
		ans += ver;
		ans %= MOD;
	}
	for (auto u : g[v]) {
		if (u != p) {
			getans(u, start, v);
		}
	}
	put.pop_back();
}

signed main() {
	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	cin >> n;
	g.resize(n);
	h.resize(n);
	dp.resize(n, ve <ll>(n, 0));
	for (int i = 0; i < n - 1; ++i) {
		ll a, b;
		cin >> a >> b;
		--a; --b;
		g[a].pb(b);
		g[b].pb(a);
	}
	dfscnt(0);
	for (int i = 0; i < n; ++i) {
		dp[i][0] = 0;
		dp[0][i] = 1;
	}
	for (int i = 1; i < n; ++i) {
		for (int j = 1; j < n; ++j) {
			dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
			dp[i][j] *= 500000004;
			dp[i][j] %= MOD;
		}
	}
	for (int i = 0; i < n; ++i) {
		getans(i, i);
	}
	cout << ans;
	return 0;
}