#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-9;
const long long mod = 1e9 + 7;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch<'0' | ch> '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void Out(int aa) {
  if (aa > 9) Out(aa / 10);
  putchar(aa % 10 + '0');
}
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ans;
}
int in[100010];
int main() {
  int n = read();
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int x = read(), y = read();
    in[x]++, in[y]++;
  }
  int x = 0;
  for (int i = 1; i <= n; i++)
    if (in[i] == 1) x++;
  long long ans = (x * 1ll * qpow(2, n - x + 1) % mod +
                   (n - x) * 1ll * qpow(2, n - x) % mod) %
                  mod;
  printf("%lld\n", ans);
  return 0;
}
