#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e6 + 6;
vector<int> near[N];
long long cnt[N];
long long binPow(int base, int exp) {
  if (exp == 0) return 1;
  if (exp == 1) return base;
  long long M = binPow(base, exp / 2);
  long long T = (M * M) % mod;
  if (exp % 2)
    return (T * base) % mod;
  else
    return T;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    near[x].push_back(y);
    near[y].push_back(x);
  }
  int leaves = 0;
  for (int i = 1; i <= n; i++) {
    if (near[i].size() == 1) leaves++;
  }
  cout << (((leaves * binPow(2, n - leaves + 1)) % mod) +
           (((n - leaves) * binPow(2, n - leaves)) % mod)) %
              mod;
}
