import os

import sys

import numpy as np



def solve(N, AB):

    mod = 10**9+7

    half = mod // 2 + 1

    G = [[0]*0 for _ in range(N+1)]

    for i in range(len(AB)):

        a, b = AB[i]

        G[a].append(b)

        G[b].append(a)

    P = [0] * (N+1)

    Size = [0] * (N+1)

    def dfs(v):

        # siz = 1

        # p = P[v]

        # for u in G[v]:

        #     if u != p:

        #         P[u] = v

        #         dfs(u)

        #         siz += Size[u]

        # Size[v] = siz

        st = [(v, 0)]

        while st:

            v, state = st.pop()

            p = P[v]

            if state == 0:

                st.append((v, 1))

                Size[v] = 1

                for u in G[v]:

                    if u != p:

                        P[u] = v

                        st.append((u, 0))

            else:

                Size[p] += Size[v]

    dfs(1)

    ans = 0

    Prob = [0]

    h = 1

    for i in range(202020):

        h = h * half % mod

        Prob.append(1-h)

    for v in range(1, len(G)):

        siz_v = Size[v]

        Gv = G[v]

        if v == 1:

            ps = [0]*0

        else:

            ps = [Prob[N-siz_v]]

        par = P[v]

        for u in Gv:

            if par != u:

                siz_u = Size[u]

                ps.append(Prob[siz_u])

        if len(ps)<=1:

            continue

        cumprod1_ps = [1, 1]

        cumprod2_ps = [1, 1]

        cp = 1

        for p in ps:

            cp = cp * (1-p) % mod

            cumprod1_ps.append(cp)

        cp = 1

        for p in ps[::-1]:

            cp = cp * (1-p) % mod

            cumprod2_ps.append(cp)

        cumprod2_ps.reverse()

        an = 1 - cumprod1_ps[-1]

        for j in range(1, len(cumprod1_ps)-1):

            cp1 = cumprod1_ps[j]

            cp2 = cumprod2_ps[j]

            p = ps[j-1]

            an -= cp1 * cp2 % mod * p

        ans += an

    ans = ans % mod * half % mod

    return ans





def main():

    sys.setrecursionlimit(505050)

    input = sys.stdin.buffer.readline

    N = int(eval(input()))

    AB = np.array(sys.stdin.buffer.read().split(), dtype=np.int64).reshape(N - 1, 2)

    ans = solve(N, AB)

    print(ans)



main()

import os

import sys

import numpy as np



def solve(N, AB):

    mod = 10**9+7

    half = mod // 2 + 1

    G = [[0]*0 for _ in range(N+1)]

    for i in range(len(AB)):

        a, b = AB[i]

        G[a].append(b)

        G[b].append(a)

    P = np.zeros(N+1, dtype=np.int64)

    Size = np.zeros(N+1, dtype=np.int64)

    def dfs(v):

        # siz = 1

        # p = P[v]

        # for u in G[v]:

        #     if u != p:

        #         P[u] = v

        #         dfs(u)

        #         siz += Size[u]

        # Size[v] = siz

        st = [(v, 0)]

        while st:

            v, state = st.pop()

            p = P[v]

            if state == 0:

                st.append((v, 1))

                Size[v] = 1

                for u in G[v]:

                    if u != p:

                        P[u] = v

                        st.append((u, 0))

            else:

                Size[p] += Size[v]

    dfs(1)

    ans = 0

    Prob = np.empty(202020, dtype=np.int64)

    h = 1

    for i in range(202020):

        Prob[i] = 1-h+mod

        h = h * half % mod

    for v in range(1, len(G)):

        siz_v = Size[v]

        Gv = G[v]

        if v == 1:

            ps = [0]*0

        else:

            ps = [Prob[N-siz_v]]

        par = P[v]

        for u in Gv:

            if par != u:

                siz_u = Size[u]

                ps.append(Prob[siz_u])

        if len(ps)<=1:

            continue

        cumprod1_ps = [1, 1]

        cumprod2_ps = [1, 1]

        cp = 1

        for p in ps:

            cp = cp * (1-p+mod) % mod

            cumprod1_ps.append(cp)

        cp = 1

        for p in ps[::-1]:

            cp = cp * (1-p+mod) % mod

            cumprod2_ps.append(cp)

        cumprod2_ps.reverse()

        an = 1 - cumprod1_ps[-1]

        for j in range(1, len(cumprod1_ps)-1):

            cp1 = cumprod1_ps[j]

            cp2 = cumprod2_ps[j]

            p = ps[j-1]

            an -= cp1 * cp2 % mod * p % mod

        ans += an

    ans = ans % mod * half % mod

    return ans





# >>> numba compile >>>

numba_config = [

    [solve, "i8(i8,i8[:,:])"],

]

if sys.argv[-1] == "ONLINE_JUDGE":

    from numba import njit

    from numba.pycc import CC

    cc = CC("my_module")

    for func, signature in numba_config:

        vars()[func.__name__] = njit(signature)(func)

        cc.export(func.__name__, signature)(func)

    cc.compile()

    exit()

elif os.name == "posix":

    exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")

else:

    from numba import njit

    for func, signature in numba_config:

        vars()[func.__name__] = njit(signature, cache=True)(func)

    print("compiled!", file=sys.stderr)

# <<< numba compile <<<





def main():

    sys.setrecursionlimit(505050)

    input = sys.stdin.buffer.readline

    N = int(input())

    AB = np.array(sys.stdin.buffer.read().split(), dtype=np.int64).reshape(N - 1, 2)

    ans = solve(N, AB)

    print(ans)



main()

import os
import sys
import numpy as np


def solve(N, AB):
    mod = 10**9 + 7
    half = mod // 2 + 1
    G = [[0] * 0 for _ in range(N + 1)]
    for i in range(len(AB)):
        a, b = AB[i]
        G[a].append(b)
        G[b].append(a)
    P = [0] * (N + 1)
    Size = [0] * (N + 1)

    def dfs(v):
        # siz = 1
        # p = P[v]
        # for u in G[v]:
        #     if u != p:
        #         P[u] = v
        #         dfs(u)
        #         siz += Size[u]
        # Size[v] = siz
        st = [(v, 0)]
        while st:
            v, state = st.pop()
            p = P[v]
            if state == 0:
                st.append((v, 1))
                Size[v] = 1
                for u in G[v]:
                    if u != p:
                        P[u] = v
                        st.append((u, 0))
            else:
                Size[p] += Size[v]

    dfs(1)
    ans = 0
    Prob = [0]
    h = 1
    for i in range(202020):
        h = h * half % mod
        Prob.append(1 - h)
    for v in range(1, len(G)):
        siz_v = Size[v]
        Gv = G[v]
        if v == 1:
            ps = [0] * 0
        else:
            ps = [Prob[N - siz_v]]
        par = P[v]
        for u in Gv:
            if par != u:
                siz_u = Size[u]
                ps.append(Prob[siz_u])
        if len(ps) <= 1:
            continue
        cumprod1_ps = [1, 1]
        cumprod2_ps = [1, 1]
        cp = 1
        for p in ps:
            cp = cp * (1 - p) % mod
            cumprod1_ps.append(cp)
        cp = 1
        for p in ps[::-1]:
            cp = cp * (1 - p) % mod
            cumprod2_ps.append(cp)
        cumprod2_ps.reverse()
        an = 1 - cumprod1_ps[-1]
        for j in range(1, len(cumprod1_ps) - 1):
            cp1 = cumprod1_ps[j]
            cp2 = cumprod2_ps[j]
            p = ps[j - 1]
            an -= cp1 * cp2 % mod * p
        ans += an
    ans = ans % mod * half % mod
    return ans


def main():
    sys.setrecursionlimit(505050)
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    AB = np.array(sys.stdin.buffer.read().split(), dtype=np.int64).reshape(N - 1, 2)
    ans = solve(N, AB)
    print(ans)


main()

import os
import sys
import numpy as np


def solve(N, AB):
    mod = 10**9 + 7
    half = mod // 2 + 1
    G = [[0] * 0 for _ in range(N + 1)]
    for i in range(len(AB)):
        a, b = AB[i]
        G[a].append(b)
        G[b].append(a)
    P = np.zeros(N + 1, dtype=np.int64)
    Size = np.zeros(N + 1, dtype=np.int64)

    def dfs(v):
        # siz = 1
        # p = P[v]
        # for u in G[v]:
        #     if u != p:
        #         P[u] = v
        #         dfs(u)
        #         siz += Size[u]
        # Size[v] = siz
        st = [(v, 0)]
        while st:
            v, state = st.pop()
            p = P[v]
            if state == 0:
                st.append((v, 1))
                Size[v] = 1
                for u in G[v]:
                    if u != p:
                        P[u] = v
                        st.append((u, 0))
            else:
                Size[p] += Size[v]

    dfs(1)
    ans = 0
    Prob = np.empty(202020, dtype=np.int64)
    h = 1
    for i in range(202020):
        Prob[i] = 1 - h + mod
        h = h * half % mod
    for v in range(1, len(G)):
        siz_v = Size[v]
        Gv = G[v]
        if v == 1:
            ps = [0] * 0
        else:
            ps = [Prob[N - siz_v]]
        par = P[v]
        for u in Gv:
            if par != u:
                siz_u = Size[u]
                ps.append(Prob[siz_u])
        if len(ps) <= 1:
            continue
        cumprod1_ps = [1, 1]
        cumprod2_ps = [1, 1]
        cp = 1
        for p in ps:
            cp = cp * (1 - p + mod) % mod
            cumprod1_ps.append(cp)
        cp = 1
        for p in ps[::-1]:
            cp = cp * (1 - p + mod) % mod
            cumprod2_ps.append(cp)
        cumprod2_ps.reverse()
        an = 1 - cumprod1_ps[-1]
        for j in range(1, len(cumprod1_ps) - 1):
            cp1 = cumprod1_ps[j]
            cp2 = cumprod2_ps[j]
            p = ps[j - 1]
            an -= cp1 * cp2 % mod * p % mod
        ans += an
    ans = ans % mod * half % mod
    return ans


# >>> numba compile >>>
numba_config = [
    [solve, "i8(i8,i8[:,:])"],
]
if sys.argv[-1] == "ONLINE_JUDGE":
    from numba import njit
    from numba.pycc import CC

    cc = CC("my_module")
    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature)(func)
        cc.export(func.__name__, signature)(func)
    cc.compile()
    exit()
elif os.name == "posix":
    exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")
else:
    from numba import njit

    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature, cache=True)(func)
    print("compiled!", file=sys.stderr)
# <<< numba compile <<<
def main():
    sys.setrecursionlimit(505050)
    input = sys.stdin.buffer.readline
    N = int(input())
    AB = np.array(sys.stdin.buffer.read().split(), dtype=np.int64).reshape(N - 1, 2)
    ans = solve(N, AB)
    print(ans)


main()

-    P = [0] * (N + 1) -    Size = [0] * (N + 1) +    P = np.zeros(N + 1, dtype=np.int64) +    Size = np.zeros(N + 1, dtype=np.int64) -    Prob = [0] +    Prob = np.empty(202020, dtype=np.int64) +        Prob[i] = 1 - h + mod -        Prob.append(1 - h) -            cp = cp * (1 - p) % mod +            cp = cp * (1 - p + mod) % mod -            cp = cp * (1 - p) % mod +            cp = cp * (1 - p + mod) % mod -            an -= cp1 * cp2 % mod * p +            an -= cp1 * cp2 % mod * p % mod +# >>> numba compile >>> +numba_config = [ +    [solve, "i8(i8,i8[:,:])"], +] +if sys.argv[-1] == "ONLINE_JUDGE": +    from numba import njit +    from numba.pycc import CC + +    cc = CC("my_module") +    for func, signature in numba_config: +        vars()[func.__name__] = njit(signature)(func) +        cc.export(func.__name__, signature)(func) +    cc.compile() +    exit() +elif os.name == "posix": +    exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}") +else: +    from numba import njit + +    for func, signature in numba_config: +        vars()[func.__name__] = njit(signature, cache=True)(func) +    print("compiled!", file=sys.stderr) +# <<< numba compile <<< -    N = int(eval(input())) +    N = int(input())