#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return f * x;
}
inline int qpow(int x, int n) {
  int ret = 1;
  while (n) {
    if (n & 1) ret = 1ll * ret * x % 1000000007;
    n >>= 1;
    x = 1ll * x * x % 1000000007;
  }
  return ret;
}
struct edge {
  int to, pre;
} G[maxn << 1];
int n, Len, s;
int head[maxn], qw[maxn], fa[maxn], f[maxn], g[maxn], b[maxn];
inline void addedge(int x, int y) {
  G[++Len].to = y;
  G[Len].pre = head[x];
  head[x] = Len;
  G[++Len].to = x;
  G[Len].pre = head[y];
  head[y] = Len;
}
inline void dfs1(int u) {
  f[u] = 0;
  for (int i = head[u]; i; i = G[i].pre)
    if (G[i].to != fa[u]) {
      int v = G[i].to;
      fa[v] = u;
      dfs1(v);
      ++b[u];
      f[u] += f[v];
    }
  if (b[u]) ++f[u];
}
inline void dfs2(int u) {
  g[u] = s;
  s += f[u];
  for (int i = head[u]; i; i = G[i].pre)
    if (G[i].to != fa[u]) {
      int v = G[i].to;
      s -= f[v];
      dfs2(v);
      s += f[v];
    }
  s -= f[u];
}
int main() {
  qw[0] = 1;
  for (int i = 1; i < maxn; ++i) qw[i] = (qw[i - 1] << 1) % 1000000007;
  memset(f, 0, sizeof(f));
  memset(g, 0, sizeof(g));
  memset(b, 0, sizeof(b));
  n = read();
  int x, y;
  for (int i = 1; i < n; ++i) {
    x = read();
    y = read();
    addedge(x, y);
  }
  dfs1(1);
  for (int i = head[1]; i; i = G[i].pre) {
    x = G[i].to;
    s = f[1] - f[x];
    if (b[1] == 1) --s;
    dfs2(x);
  }
  for (int i = 1; i <= n; ++i)
    if (!b[i]) ++g[i];
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans = (ans + qw[f[i] + g[i]]) % 1000000007;
  printf("%d\n", ans);
}
