#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
inline long long mul(long long a, long long b) {
  return ((a % MOD) * (b % MOD)) % MOD;
}
inline long long add(long long a, long long b) {
  return ((a % MOD) + (b % MOD)) % MOD;
}
long long binpow(long long a, long long b, long long m = MOD) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long inverse(long long x) { return binpow(x, MOD - 2, MOD); }
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j;
  long long n;
  cin >> n;
  vector<long long> tree[n];
  for (i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    --u;
    --v;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  long long leaves = 0;
  for (i = 0; i < n; i++)
    if (tree[i].size() == 1) leaves++;
  long long ans1 = mul(leaves, binpow(2, n - leaves + 1));
  long long ans2 = mul(n - leaves, binpow(2, n - leaves));
  cout << add(ans1, ans2) << "\n";
  return 0;
}
