#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int n;
const int mxN = 1e5 + 5;
vector<int> adj[mxN];
const long long MOD = 1e9 + 7;
long long mul(long long a, long long b) {
  a = (a % MOD + MOD) % MOD;
  b = (b % MOD + MOD) % MOD;
  return (a * b) % MOD;
}
long long modpow(long long a, long long b) {
  if (b == 0) return 1;
  long long res = modpow(a, b / 2);
  if (b % 2) return mul(res, mul(res, a));
  return mul(res, res);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  set<int> leaves;
  for (int i = 0; i < n; i++) {
    if ((int)adj[i].size() == 1) leaves.insert(i);
  }
  long long tot = 0;
  for (int u = 0; u < n; u++) {
    int nl, nb;
    if (leaves.find(u) != leaves.end())
      nl = (int)leaves.size() - 1, nb = n - nl;
    else
      nl = (int)leaves.size(), nb = n - nl;
    tot = (tot + modpow(2, nb)) % MOD;
  }
  cout << tot;
  return 0;
}
