#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;
int N, deg[maxn];
int main() {
  int pow[maxn];
  pow[0] = 1;
  for (int i = 1; i < maxn; i++) pow[i] = (pow[i - 1] * 2) % MOD;
  scanf("%d", &N);
  if (N == 1) {
    printf("1");
    return 0;
  }
  for (int i = 1; i < N; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    deg[u]++, deg[v]++;
  }
  int leaves = 0;
  for (int i = 1; i <= N; i++)
    if (deg[i] == 1) leaves++;
  cout << (1ll * pow[N - leaves] * (N - leaves) +
           1ll * pow[N - leaves + 1] * leaves) %
              MOD;
}
