#include <bits/stdc++.h>
using namespace std;
const int NR = 1e5 + 10;
const int mod = 1e9 + 7;
void Min(int& x, int y) { x = min(x, y); }
void Max(int& x, int y) { x = max(x, y); }
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 << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n;
long long ans;
int rd[NR];
int to[NR << 1], nxt[NR << 1], head[NR], tot = 1;
void add(int x, int y) { to[tot] = y, nxt[tot] = head[x], head[x] = tot++; }
int ksm(int a, int b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return res;
}
int f[NR], dp[NR];
void dfs1(int x, int fa_) {
  dp[x] = 1;
  int t1 = 1, t2 = 0;
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != fa_) dfs1(to[i], x);
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != fa_) t1 = 1ll * t1 * dp[to[i]] % mod, t2++;
  if (t2) dp[x] = t1 * 2;
}
void dfs2(int x, int fa_) {
  int F = 1ll * ksm(dp[x], mod - 2) * f[fa_] % mod;
  if (rd[fa_] == 1) F = 1ll * F * ksm(2, mod - 2) % mod;
  f[x] = F;
  for (int i = head[x]; i; i = nxt[i]) {
    if (to[i] == fa_) continue;
    f[x] = 1ll * f[x] * dp[to[i]] % mod;
  }
  f[x] = f[x] * 2 % mod;
  ans = (ans + f[x]) % mod;
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != fa_) dfs2(to[i], x);
}
int main() {
  n = read();
  for (int i = 1, x, y; i < n; i++)
    x = read(), y = read(), add(x, y), add(y, x), rd[x]++, rd[y]++;
  dfs1(1, 0);
  f[1] = dp[1];
  for (int i = head[1]; i; i = nxt[i]) dfs2(to[i], 1);
  printf("%lld\n", (ans + f[1]) % mod);
  return 0;
}
