#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
long long mod(long long n) {
  n %= MOD;
  if (n < 0)
    return n + MOD;
  else
    return n;
}
long long fp(long long a, long long p) {
  long long ans = 1, c = a;
  for (long long i = 0; (1ll << i) <= p; ++i) {
    if ((p >> i) & 1) ans = mod(ans * c);
    c = mod(c * c);
  }
  return ans;
}
long long dv(long long a, long long b) { return mod(a * fp(b, MOD - 2)); }
const long long N = 1e5 + 7;
vector<long long> g[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long lief = 0;
  for (long long i = 1; i <= n; ++i) lief += g[i].size() == 1;
  long long ans = 0;
  for (long long i = 1; i <= n; ++i) {
    bool is = g[i].size() == 1;
    ans = mod(ans + fp(2, n - (lief - is)));
  }
  cout << ans << '\n';
}
