#include <bits/stdc++.h>
using namespace std;
int sz[100005];
long long pw[100005];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    sz[a]++;
    sz[b]++;
  }
  int lf = 0;
  for (int i = 1; i <= n; i++)
    if (sz[i] == 1) lf++;
  pw[0] = 1LL;
  for (int i = 1; i <= 100000; i++) pw[i] = (pw[i - 1] * 2) % 1000000007;
  long long res = lf * pw[n - lf + 1] + (n - lf) * pw[n - lf];
  res %= 1000000007;
  cout << res;
  return 0;
}
