#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll power(ll a, ll n) {
  ll ref = 1;
  while (n) {
    if (n & 1) ref = (ref * a) % 1000000007;
    a = (a * a) % 1000000007;
    n /= 2;
  }
  return ref;
}
int main() {
  ll n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x]++, v[y]++;
  }
  ll l = 0;
  for (int i = 0; i <= n; i++)
    if (v[i] == 1) l++;
  ll ans = 0;
  ans += (n - l) * power(2, n - l);
  ans %= 1000000007;
  ans += l * power(2, n - l + 1);
  ans %= 1000000007;
  cout << ans;
}
