#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int i, i0, n, m;
long long dp[100005], ans;
vector<int> mp[100005];
void extgcd(long long a, long long b, long long& d, long long& x,
            long long& y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    extgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long n = mod) {
  if (a < 0) a += n;
  long long d, x, y;
  extgcd(a, n, d, x, y);
  return d == 1 ? (x + n) % n : -1;
}
void dfs(int now, int root) {
  dp[now] = 1 + (mp[now].size() != 1 || now == 1);
  for (int it : mp[now]) {
    if (it == root) continue;
    dfs(it, now);
    dp[now] *= dp[it], dp[now] %= mod;
  }
}
void solve(int now, int root);
void change_root(int nowa, int nowb) {
  long long tmpa = dp[nowa], tmpb = dp[nowb];
  dp[nowa] *= inv(dp[nowb]), dp[nowa] %= mod;
  if (mp[nowa].size() == 1) dp[nowa] *= inv(2), dp[nowa] %= mod;
  dp[nowb] *= dp[nowa], dp[nowb] %= mod;
  if (mp[nowb].size() == 1) dp[nowb] *= 2, dp[nowb] %= mod;
  solve(nowb, nowa);
  dp[nowa] = tmpa;
  dp[nowb] = tmpb;
}
void solve(int now, int root) {
  ans += dp[now], ans %= mod;
  for (int it : mp[now]) {
    if (it == root) continue;
    change_root(now, it);
  }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  dfs(1, -1);
  solve(1, -1);
  printf("%lld\n", ans);
  return 0;
}
