#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
vector<int> G[100005];
int cnt[100005];
int main() {
  int N, a, b;
  scanf("%d", &N);
  for (int i = 1; i < N; i++) {
    scanf("%d%d", &a, &b);
    cnt[a]++;
    cnt[b]++;
  }
  int x = 0;
  for (int i = 1; i <= N; i++)
    if (cnt[i] == 1) x++;
  long long m = 1;
  for (int i = 1; i <= N - x; i++) m = m * 2 % MOD;
  printf("%lld\n", ((N - x) * m + x * m * 2) % MOD);
  return 0;
}
