#include <bits/stdc++.h>
using namespace std;
inline int read(register int ans = 0, register int sgn = ' ',
                register int ch = getchar()) {
  for (; ch < '0' || ch > '9'; sgn = ch, ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; (ans *= 10) += ch - '0', ch = getchar())
    ;
  return sgn - '-' ? ans : -ans;
}
int in[100005], n, num, MOD = 1000000007;
inline int fastpow(int s, int n) {
  int a = 1;
  for (; n; n& 1 ? a = 1ll * a * s % MOD : 0, s = 1ll * s * s % MOD, n >>= 1)
    ;
  return a;
}
int main() {
  n = read();
  for (register int i = 2; i <= n; ++in[read()], ++in[read()], i++)
    ;
  for (register int i = 1; i <= n; num += in[i] == 1, i++)
    ;
  printf("%d\n", (1ll * num * fastpow(2, n - num + 1) % MOD +
                  1ll * (n - num) * fastpow(2, n - num) % MOD) %
                     MOD);
  return 0;
}
