#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 3;
const long long MOD = 1e9 + 7;
vector<int> v[MAXN];
int oj[MAXN];
long long dp[MAXN];
long long wyn = 0;
long long ret;
long long fastpow(long long x, long long y) {
  ret = 1;
  while (y) {
    if (y & 1) {
      ret *= x;
      ret %= MOD;
    }
    y /= 2;
    x *= x;
    x %= MOD;
  }
  return ret;
}
void DFS(int x) {
  if (v[x].size() == 1 && x != 1) {
    dp[x] = 1;
    return;
  }
  for (auto it : v[x]) {
    if (it == oj[x]) continue;
    oj[it] = x;
    DFS(it);
  }
  dp[x] = 2;
  for (auto it : v[x]) {
    if (it != oj[x]) {
      dp[x] *= dp[it];
      dp[x] %= MOD;
    }
  }
}
void DFS2(int x) {
  wyn += dp[x];
  if (wyn > MOD) wyn -= MOD;
  long long pop = dp[x];
  if (x == 1 && v[x].size() == 1) {
    dp[x] *= fastpow(2, MOD - 2);
    dp[x] %= MOD;
  }
  for (auto it : v[x]) {
    if (it == oj[x]) continue;
    dp[x] *= fastpow(dp[it] % MOD, MOD - 2);
    dp[x] %= MOD;
    dp[it] *= dp[x];
    dp[it] %= MOD;
    if (v[it].size() == 1) {
      dp[it] *= 2;
      dp[it] %= MOD;
    }
    DFS2(it);
    dp[x] = pop;
  }
}
int main() {
  int n, x, y;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  DFS(1);
  DFS2(1);
  printf("%lld", wyn);
  return 0;
}
