import sys input = sys.stdin.buffer.readline n = int(input()) mod = 10 ** 9 + 7 graph = [[] for _ in range(n)] for _ in range(n - 1): a, b = map(int, input().split()) a, b = a - 1, b - 1 graph[a].append(b) graph[b].append(a) # graph and n are necessary idx = 0 # graph and n is necessary def dfs(start): par = [-1] * n depth = [-1] * n euler = [] stack = [] stack.append(start) depth[start] = 0 while stack: v = stack.pop() euler.append(v) d = depth[v] for u in graph[v]: if par[v] == u: continue par[u] = v depth[u] = d + 1 stack.append(u) return par, euler par, euler = dfs(0) dp1 = [0] * n for v in euler[::-1]: dp1[v] = 1 for u in graph[v]: if u == par[v]: continue dp1[v] += dp1[u] dp1[v] %= mod dp2 = [0] * n for v in range(n): dp2[v] = n - dp1[v] ans = 0 for v in range(n): # 下側 ans += (n - dp1[v]) * dp1[v] ans %= mod for u in graph[v]: if u == par[v]: continue # 上側 ans += dp2[u] * dp1[u] ans %= mod # 自分中心 ans += n ans %= mod print(ans)