#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int mod = 1e9 + 7;
int two[N];
int deg[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  two[0] = 1;
  for (int i = 1; i < N; i++) {
    two[i] = (two[i - 1] + two[i - 1]) % mod;
  }
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
  }
  int internal_node = 0;
  for (int i = 1; i <= n; i++) {
    internal_node += (deg[i] > 1);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      ans += two[internal_node + 1];
    } else {
      ans += two[internal_node];
    }
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
