#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<vector<int>> v(n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    v[--a].push_back(--b);
    v[b].push_back(a);
  }
  vector<int64_t> d(n, 1);
  for (int i = 1; i < n; ++i) {
    d[i] = (2 * d[i - 1]) % MOD;
  }
  int64_t ans = 0;
  int k = n - 1;
  for (int i = 0; i < n; ++i) {
    if (v[i].size() > 2) {
      k -= v[i].size() - 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (v[i].size() >= 2) {
      ans += d[k - 1];
    } else {
      ans += d[k];
    }
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
