#include <bits/stdc++.h>   using namespace std;      template <int _mod = 998244353>   class Modular {       private:     static constexpr int mod = _mod;     static_assert(_mod > 0,  mod must be positive );          int value;       public:        Modular() : value(0) {}     template <typename U> Modular(const U& _value) {       value = normalize(_value);     }            template <typename U> static int normalize(const U& _value) {       int v;       if (-mod <= _value && _value < mod) v = static_cast<int>(_value);       else v = static_cast<int>(_value % mod);       if (v < 0) v += mod;       return v;     }     template <typename U> static U inverse(U a, U m) {       U u = 0, v = 1;       while (a != 0) {         U t = m / a;         m -= t * a; swap(a, m);         u -= t * v; swap(u, v);       }       assert(m == 1);       return u;     }            const int& operator ()() const { return value; }     template <typename U> explicit operator U() const { return static_cast<U>(value); }        template <typename U> friend U& operator << (U& stream, const Modular& number) {       return stream << number();     }     template <typename U> friend U& operator >> (U& stream, Modular& number) {       long long x;       stream >> x;       number.value = normalize(x);       return stream;     }        Modular& operator -= (const Modular& other) { if ((value -= other.value) < 0) value += mod; return *this; }     template <typename U> Modular& operator -= (const U& other) { return *this -= Modular(other); }     Modular& operator += (const Modular& other) { return *this -= Modular(mod - other.value); }     template <typename U> Modular& operator += (const U& other) { return *this += Modular(other); }     Modular& operator ++ () { return *this += 1; }     Modular& operator -- () { return *this -= 1; }     Modular operator ++ (int) { Modular result(*this); *this += 1; return result; }     Modular operator -- (int) { Modular result(*this); *this -= 1; return result; }     Modular operator - () const { return Modular(-value); }            Modular& operator *= (const Modular& other) {       value = normalize(static_cast<long long>(value) * static_cast<long long>(other.value));       return *this;     }     template <typename U> Modular& operator *= (const U& other) { return *this *= Modular(other); }     Modular& operator /= (const Modular& other) { return *this *= Modular(inverse(other.value, mod)); }     template <typename U> Modular& operator /= (const U& other) { return *this /= Modular(other); }            friend bool operator == (const Modular& first, const Modular& second) { return first.value == second.value; }     template <typename U> friend bool operator == (const Modular& first, const U& second) { return first == Modular(second); }     template <typename U> friend bool operator == (const U& first, const Modular& second) { return Modular(first) == second; }            friend bool operator != (const Modular& first, const Modular& second) { return !(first.value == second.value); }     template <typename U> friend bool operator != (const Modular& first, const U& second) { return first != Modular(second); }     template <typename U> friend bool operator != (const U& first, const Modular& second) { return Modular(first) != second; }        friend Modular operator + (const Modular& first, const Modular& second) { return Modular(first) += second; }     template <typename U> friend Modular operator + (const Modular& first, const U& second) { return Modular(first) += second; }     template <typename U> friend Modular operator + (const U& first, const Modular& second) { return Modular(first) += second; }        friend Modular operator - (const Modular& first, const Modular& second) { return Modular(first) -= second; }     template <typename U> friend Modular operator - (const Modular& first, const U& second) { return Modular(first) -= second; }     template <typename U> friend Modular operator - (const U& first, const Modular& second) { return Modular(first) -= second; }        friend Modular operator * (const Modular& first, const Modular& second) { return Modular(first) *= second; }     template <typename U> friend Modular operator * (const Modular& first, const U& second) { return Modular(first) *= second; }     template <typename U> friend Modular operator * (const U& first, const Modular& second) { return Modular(first) *= second; }        friend Modular operator / (const Modular& first, const Modular& second) { return Modular(first) /= second; }     template <typename U> friend Modular operator / (const Modular& first, const U& second) { return Modular(first) /= second; }     template <typename U> friend Modular operator / (const U& first, const Modular& second) { return Modular(first) /= second; }          template <typename U> friend Modular power(const Modular& base, const U& exponent) {       assert(exponent >= 0);       Modular x = base, res = 1;       U p = exponent;       while (p > 0) {         if(p & 1) res *= x;         x *= x;         p >>= 1;       }       return res;     }    };      using Mint = Modular<int(1e9)+7>;   // <, >, <=, >= comparisons not available   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int n;     cin >> n;     const int inf = 1e9 + 5;     vector<vector<int>> dis(n, vector<int>(n, inf));     for (int i = 0; i < n; i++) {       dis[i][i] = 0;     }     for (int i = 0; i < n - 1; i++) {       int u, v;       cin >> u >> v;       --u, --v;       dis[u][v] = dis[v][u] = 1;     }     for (int k = 0; k < n; k++) {       for (int i = 0; i < n; i++) {         for (int j = 0; j < n; j++) {           dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);         }       }     }     vector<vector<Mint>> dp(n + 1, vector<Mint>(n + 1));     for (int i = 1; i <= n; i++) {       dp[i][0] = 1;       for (int j = 1; j <= n; j++) {         dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) / 2;       }     }     Mint ans = 0;     for (int r = 0; r < n; r++) {       for (int i = 0; i < n; i++) {         for (int j = i + 1; j < n; j++) {           int x = dis[i][r], y = dis[r][j];           int d = (x + y - dis[i][j]) / 2;           x -= d, y -= d;           ans += dp[x][y];         }       }     }     ans /= n;     cout << ans <<   n ;     return 0;   }