#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  long long ans = 1;
  a %= m;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return ans;
}
long long n, leaves = 0;
vector<long long> v[1000001];
bool leaf[1000001];
void dfs(long long node, long long par) {
  leaf[node] = (v[node].size() == 1);
  for (auto x : v[node]) {
    if (x == par) continue;
    dfs(x, node);
  }
  leaves += leaf[node];
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1, 0);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += power(2, n - (leaves - leaf[i]), 1000000007);
    ans %= 1000000007;
  }
  cout << ans << '\n';
}
