#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n;
vector<long long> adj[N];
long long inv2;
const long long MOD = 1e9 + 7;
long long bpow(long long a, long long b) {
  long long x = 1;
  long long y = a;
  while (b > 0) {
    if (b % 2 == 1) x = (x * y) % MOD;
    if (x < 0) x += MOD;
    y = (y * y) % MOD;
    if (y < 0) y += MOD;
    b /= 2;
  }
  x = (x % MOD);
  if (x < 0) x += MOD;
  return x;
}
long long solve(long long x, long long y) {
  if (adj[y].size() == 1) return 2;
  if (adj[y].size() == 2) {
    long long z = adj[y][0];
    if (z == x) z = adj[y][1];
    return ((2 * solve(y, z)) % MOD);
  }
  long long ans = 4;
  for (auto v : adj[y]) {
    if (v == x) continue;
    ans = (ans * solve(y, v)) % MOD;
    ans = (ans * inv2) % MOD;
  }
  return ans;
}
long long res = 0;
void solve2(long long u, long long p, long long prev, long long cur,
            long long k) {
  if (prev == 1 && cur >= 2)
    k = (k * inv2) % MOD;
  else if (prev >= 2 && cur == 1)
    k = (k * 2) % MOD;
  res = (res + k) % MOD;
  for (auto v : adj[u]) {
    if (v == p) continue;
    solve2(v, u, cur, adj[v].size(), k);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  long long a, b;
  long long lf = 0;
  for (long long i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (long long i = 0; i < n; i++)
    if (adj[i].size() == 1) lf = i;
  inv2 = bpow(2, MOD - 2);
  long long k = solve(lf, adj[lf][0]);
  solve2(lf, -1, 0, 1, k);
  cout << res << "\n";
  return 0;
}
