#include <bits/stdc++.h>
using namespace std;
long long n, x, y, s, t, P = (long long)(1e9 + 7);
long long b[110000];
long long q(long long b, long long p) {
  s = 1;
  while (p) {
    if (p % 2) s = s * b % P;
    b = b * b % P;
    p /= 2;
  }
  return s;
}
signed main() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    scanf("%lld%lld", &x, &y);
    b[x]++;
    b[y]++;
  }
  for (long long i = 1; i <= n; i++)
    if (b[i] == 1) t++;
  cout << (n + t) * q(2, n - t) % P;
  return 0;
}
