#include <bits/stdc++.h>
using namespace std;
int n, leaf, po;
vector<int> v[100005];
int main() {
  scanf("%d", &n);
  for (int i = (2); i <= (n); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = (1); i <= (n); i++)
    if (v[i].size() == 1) leaf++;
  po = 1;
  for (int i = (1); i <= (n - leaf); i++) po = (po + po) % 1000000007;
  printf("%d\n", (1LL * po * (n - leaf) + 2LL * po * leaf) % 1000000007);
  return 0;
}
