#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int N = 1e5 + 7;
int n, tot;
int in[N];
int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
long long quick_mod(long long b, int p) {
  long long s = 1;
  for (; p; p >>= 1, b = b * b % mod)
    if (p & 1) s = s * b % mod;
  return s;
}
int main() {
  n = read();
  for (int i = 1; i < n; i++) in[read()]++, in[read()]++;
  for (int i = 1; i <= n; i++)
    if (in[i] == 1) tot++;
  printf("%d\n", (n + tot) * quick_mod(2, n - tot) % mod);
  return 0;
}
