#include <bits/stdc++.h>
using namespace std;
int n;
int cnt = 0;
int a[100001];
const long long Mod = 1e9 + 7;
long long power(long long x, int n) {
  if (!n) return 1;
  if (n % 2 == 0) return power(x * x % Mod, n / 2);
  return x * power(x * x % Mod, n / 2) % Mod;
}
int main() {
  cin >> n;
  cnt = 0;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    a[u]++;
    a[v]++;
  }
  for (int i = 1; i <= n; i++) cnt += a[i] == 1;
  cout << ((n - cnt) * power(2, n - cnt) % Mod +
           cnt * power(2, n - cnt + 1) % Mod) %
              Mod;
  return 0;
}
