#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const long long mod = 1e9 + 7;
int n, u, v;
long long ans;
vector<int> path[maxn];
int fa[maxn];
long long dp[maxn][2][2];
pair<long long, long long> exgcd(long long a, long long b) {
  if (b == 0)
    return make_pair(1, 0);
  else {
    pair<long long, long long> tmp = exgcd(b, a % b);
    return make_pair(tmp.second, tmp.first - a / b * tmp.second);
  }
}
long long rev(long long p) { return exgcd(p, mod).first; }
void dfs(int p, int father) {
  fa[p] = father;
  long long s[2] = {1ll, 1ll};
  for (int i = 0; i < path[p].size(); i++) {
    if (path[p][i] != father) {
      dfs(path[p][i], p);
      (s[0] *= dp[path[p][i]][1][0]) %= mod;
      (s[1] *= dp[path[p][i]][1][1]) %= mod;
    }
  }
  if (p != 1 && path[p].size() == 1) {
    dp[p][0][0] = 1ll;
    dp[p][0][1] = 0ll;
    dp[p][1][0] = 1ll;
    dp[p][1][1] = 1ll;
  } else {
    dp[p][0][0] = s[0];
    dp[p][0][1] = s[1];
    dp[p][1][0] = dp[p][1][1] = (s[0] + s[1]) % mod;
  }
  return;
}
void dfs1(int p, long long father) {
  if (p != 1 && path[p].size() == 1)
    (ans += father * 2) %= mod;
  else
    (ans += dp[p][0][0] * father + dp[p][0][1] * father) %= mod;
  for (int i = 0; i < path[p].size(); i++) {
    if (path[p][i] != fa[p]) {
      if (p != 1 || path[p].size() > 1)
        dfs1(path[p][i],
             dp[p][0][0] * father % mod * rev(dp[path[p][i]][1][0]) % mod +
                 dp[p][0][1] * father % mod * rev(dp[path[p][i]][1][1]) % mod);
      else
        dfs1(path[p][i],
             dp[p][0][0] * father % mod * rev(dp[path[p][i]][1][0]) % mod);
    }
  }
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    path[u].push_back(v);
    path[v].push_back(u);
  }
  dfs(1, 1);
  ans = 0ll;
  dfs1(1, 1);
  printf("%I64d\n", (ans % mod + mod) % mod);
  return 0;
}
