#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long base, long long exponent, long long modx = mod) {
  long long ret = 1 % modx;
  base %= modx;
  while (exponent) {
    if (exponent & 1) {
      ret = (ret * base) % modx;
    }
    base = (base * base) % modx;
    exponent >>= 1;
  }
  return ret;
}
long long inv(long long val, long long modx = mod) {
  return power(val, modx - 2, modx);
}
vector<vector<int> > T;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> deg(n, 0);
  T.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    deg[u]++;
    deg[v]++;
    T[u].push_back(v);
    T[v].push_back(u);
  }
  if (n == 1) {
    cout << 1 << '\n';
    return 0;
  }
  int l = count((deg).begin(), (deg).end(), 1);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (deg[i] == 1) {
      ans += power(2, n - l + 1);
    } else {
      ans += power(2, n - l);
    }
    ans %= mod;
  }
  cout << ans << '\n';
  return 0;
}
