#include <bits/stdc++.h>
using namespace std;
#define nl "\n"
#define pb push_back
#define rep(i,s,n) for(int i=s;i<n;i++)
#define fill_arr(arr) for(auto &x:arr) cin>>x;

int mod = 1e9+7;
vector<vector<int>> A;
vector<int> path;
int get_size(int u,int *vis){
    *(vis+u)=1;
    int cnt=1;
    for(int x: A[u]){
        if(x>0 &&(*(vis+x))==0){
            cnt+=get_size(x,vis);
        }
    }
    return cnt;
}
bool dfs(int u,int target,int *vis){
    *(vis+u)=1;
    if(u==target){
        path.pb(u);
        *(vis+u)=1;
        return true;
    }
    bool flag = false;
    
    for(int x: A[u]){
        
        if((x>0) && ((*(vis+x))==0)){
            bool check = dfs(x,target,vis);
            if (check) flag = true;
            else *(vis+x)=0;
        }
    }
    if(flag) path.pb(u);
    return flag;
}
int gcd(int a, int b, int& x, int& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int x1, y1;
    int d = gcd(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}

void solve(){
    int n;
    cin>>n;
    A.clear();
    rep(i,0,n+1) A.pb({0});
    rep(i,0,n-1){
        int u,v;
        cin>>u>>v;
        A[u].pb(v);
        A[v].pb(u);
    }
    int arr[n+1][n+1];
    rep(i,1,n+1){arr[i][0]=0; arr[0][i]=1;}
    rep(i,1,n+1){
        rep(j,1,n+1){
            int val = ((1ll*arr[i-1][j])+arr[i][j-1])%mod;
            if(val&1) val+=mod;
            arr[i][j] = (val/2)%mod;
        }
    }
    int ans=0;
     int x,y;
     int denom = n;
    gcd(denom,mod,x,y);
    rep(i,2,n+1){
       
        rep(j,1,i){
            int vis[n+1];
            int *p;
            p = (int *) vis;
            rep(k,0,n+1) vis[k]=0;
            path.clear();
            vis[0]=1;
            dfs(j,i,p);
            rep(k,0,path.size()-1){
                int a = k;
                int b = path.size()-a-1;
                int numer = (1ll*get_size(path[k],p)*arr[a][b])%mod;
                ans = ((ans%mod)+((1ll*(x%mod)*(numer%mod))%mod))%mod;
                ans = (ans+mod)%mod;
            }
        }
    }
    cout<<ans<<nl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif  
    int t,x,y;
    // cin>>t;
    t=1;
    while(t--)
        solve();
    
    
   return 0;
}