#include <bits/stdc++.h>
using namespace std;
long long n, ans, rec, fa[1000000];
long long g[1000000][2], f[1000000][2];
long long read() {
  long long x = 0, k = 1;
  char c;
  c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') k = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * k;
}
struct edge {
  long long cnp, to[1000000], last[1000000], head[1000000];
  edge() { cnp = 2; }
  void add(long long u, long long v) {
    to[cnp] = v, last[cnp] = head[u], head[u] = cnp++;
    to[cnp] = u, last[cnp] = head[v], head[v] = cnp++;
  }
} E1;
void Up(long long &x, long long y) { x = (x + y) % 1000000007; }
long long Inv(long long x) {
  long long base = 1, timer = 1000000007 - 2;
  for (; timer; timer >>= 1, x = x * x % 1000000007)
    if (timer & 1) base = base * x % 1000000007;
  return base;
}
void dfs(long long u) {
  long long t1 = 1, flag = 0;
  for (long long i = E1.head[u]; i; i = E1.last[i]) {
    long long v = E1.to[i];
    if (v == fa[u]) continue;
    fa[v] = u;
    dfs(v);
    flag = 1;
    t1 = t1 * ((g[v][0] + g[v][1]) % 1000000007) % 1000000007;
  }
  if (flag)
    g[u][0] = g[u][1] = t1 % 1000000007;
  else
    g[u][0] = 1, g[u][1] = 0;
}
void dfs2(long long u) {
  long long t1 = f[fa[u]][0] * g[fa[u]][0] % 1000000007 *
                 Inv(g[u][0] + g[u][1]) % 1000000007;
  long long t2 = f[fa[u]][1] * g[fa[u]][1] % 1000000007 *
                 Inv(g[u][0] + g[u][1]) % 1000000007;
  f[u][0] = f[u][1] = (t1 + t2) % 1000000007;
  if (u == 1) f[u][0] = 1;
  if (u == 1 && rec != 1) f[u][1] = 1;
  Up(ans, (f[u][0] * g[u][0]) % 1000000007 * 2 % 1000000007);
  for (long long i = E1.head[u]; i; i = E1.last[i]) {
    long long v = E1.to[i];
    if (v == fa[u]) continue;
    dfs2(v);
  }
}
signed main() {
  n = read();
  for (long long i = 1; i < n; i++) {
    long long x = read(), y = read();
    E1.add(x, y);
    if (x == 1 || y == 1) rec++;
  }
  dfs(1);
  dfs2(1);
  printf("%I64d\n", ans);
  return 0;
}
