#include <bits/stdc++.h>
int n, u, v, du[100005], num;
int main() {
  scanf("%d", &n);
  if (n == 1) return printf("1\n"), 0;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    du[u]++, du[v]++;
  }
  for (int i = 1; i <= n; i++)
    if (du[i] == 1) num++;
  int x = 1;
  for (int i = 1; i <= n - num; i++) x = x * 2 % 1000000007;
  printf("%d\n",
         (1ll * num * x * 2 % 1000000007 + 1ll * (n - num) * x % 1000000007) %
             1000000007);
  return 0;
}
