#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
inline long long mul(long long x, long long y, long long m) {
  long long z = 1LL * x * y;
  if (z >= m) z %= m;
  return z;
}
inline long long add(long long x, long long y, long long m) {
  long long z = x + y;
  if (z >= m) z %= m;
  return z;
}
inline long long sub(long long x, long long y, long long m) {
  long long z = x - y;
  if (z < 0) z += m;
  z %= m;
  return z;
}
const long long N = 100005;
long long c[N];
long long powmod(long long x, long long y) {
  long long r = 1;
  while (y) {
    if (y & 1) r = mul(r, x, 1000000007);
    y >>= 1;
    x = mul(x, x, 1000000007);
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, x, y;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) cin >> x >> y, c[x]++, c[y]++;
  long long l = 0;
  for (long long i = 1; i < n + 1; i++)
    if (c[i] == 1) l++;
  long long ans = 0;
  for (long long i = 1; i < n + 1; i++) {
    long long r = n - l;
    if (c[i] == 1) r++;
    ans = add(ans, powmod(2, r), 1000000007);
  }
  cout << ans;
  return 0;
}
