#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long f[100010][2][2];
long long ff[100010][2];
int pd[100010], pd1[100010];
struct ss {
  int to, next;
} e[200010];
int first[100010], num;
int n;
void Input();
void build(int, int);
void work();
void dfs_1(int, int);
void dfs_2(int, int);
long long Sqr(long long, int);
int main() {
  Input();
  work();
  return 0;
}
void Input() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &j, &k);
    build(j, k);
    build(k, j);
  }
}
void build(int f, int t) {
  e[++num].next = first[f];
  e[num].to = t;
  first[f] = num;
}
void work() {
  int i;
  long long ans = 0;
  dfs_1(1, 0);
  if (!pd1[1]) ff[1][1] = 1;
  dfs_2(1, 0);
  ff[1][1] = 1;
  for (i = 1; i <= n; i++) {
    if (!pd[i])
      (ans += (f[i][0][0] * ff[i][0] % mod + f[i][1][0] * ff[i][1] % mod) %
              mod) %= mod;
    else {
      (ans += ff[i][0] + ff[i][1] % mod) %= mod;
    }
  }
  printf("%lld", ans);
}
void dfs_1(int now, int fa) {
  int i, P = 0;
  f[now][0][0] = f[now][0][1] = f[now][1][0] = f[now][1][1] = 1;
  for (i = first[now]; i; i = e[i].next)
    if (e[i].to != fa) {
      P++;
      dfs_1(e[i].to, now);
      (f[now][0][0] *= (f[e[i].to][0][0] + f[e[i].to][1][0])) %= mod;
      (f[now][0][1] *= (f[e[i].to][0][1] + f[e[i].to][1][1])) %= mod;
      (f[now][1][0] *= (f[e[i].to][0][1] + f[e[i].to][1][1])) %= mod;
      (f[now][1][1] *= (f[e[i].to][0][0] + f[e[i].to][1][0])) %= mod;
    }
  if (!P) {
    f[now][0][1] = f[now][1][0] = 0;
    pd[now] = 1;
  }
  if (P == 1) pd1[now] = 1;
}
void dfs_2(int now, int fa) {
  int i;
  if (now == 1)
    ff[now][0] = 1;
  else {
    int inv0 = Sqr((f[now][0][0] + f[now][1][0]) % mod, mod - 2);
    int inv1 = Sqr((f[now][0][1] + f[now][1][1]) % mod, mod - 2);
    ff[now][0] = ((f[fa][0][0] * ff[fa][0] % mod) * inv0 % mod +
                  (f[fa][1][0] * ff[fa][1] % mod) * inv1 % mod) %
                 mod;
    ff[now][1] = ((f[fa][0][1] * ff[fa][1] % mod) * inv1 % mod +
                  (f[fa][1][1] * ff[fa][0] % mod) * inv0 % mod) %
                 mod;
  }
  for (i = first[now]; i; i = e[i].next)
    if (e[i].to != fa) dfs_2(e[i].to, now);
}
long long Sqr(long long x, int n) {
  long long ret = 1;
  while (n) {
    if (n & 1) (ret *= x) %= mod;
    n >>= 1;
    (x *= x) %= mod;
  }
  return ret;
}
