#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
using namespace std;
long long n, u, v, ans, dp[100005], cntt[100005];
vector<vector<long long> > g(100005);
bool used[100005];
long long bpow(long long x, long long p) {
  if (p == 0) return 1;
  long long cur = bpow(x, p >> 1);
  cur = (cur * cur) % MOD;
  if (p & 1) cur = (cur * x) % MOD;
  return cur;
}
void countDp(long long x) {
  used[x] = true;
  long long cans = 1, cnt = 0;
  ;
  for (int i = 0; i < g[x].size(); i++) {
    if (!used[g[x][i]]) {
      countDp(g[x][i]);
      cnt++;
      cans = (cans * dp[g[x][i]]) % MOD;
    }
  }
  if (cnt != 0) cans = (2 * cans) % MOD;
  cntt[x] = cnt;
  dp[x] = cans;
}
void countAns(long long x, long long mlt, bool root) {
  used[x] = true;
  if (!root && cntt[x] == 0) {
    dp[x] = (dp[x] * 2) % MOD;
  }
  dp[x] = (dp[x] * mlt) % MOD;
  ans = (ans + dp[x]) % MOD;
  for (int i = 0; i < g[x].size(); i++) {
    if (!used[g[x][i]]) {
      if (root && cntt[x] == 1)
        countAns(
            g[x][i],
            (((dp[x] * bpow(dp[g[x][i]], MOD - 2)) % MOD) * bpow(2, MOD - 2)) %
                MOD,
            0);
      else
        countAns(g[x][i], (dp[x] * bpow(dp[g[x][i]], MOD - 2)) % MOD, 0);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  countDp(1);
  for (int i = 1; i <= n; i++) {
    used[i] = false;
  }
  countAns(1, 1, 1);
  cout << ans;
  return 0;
}
