#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const long long MOD = 1e9 + 7;
using namespace std;
long long step[MAXN];
long long f[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, res = 0, i, k1 = 0, k2 = 0;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  step[0] = 1;
  for (i = 1; i <= n + 1; ++i) step[i] = step[i - 1] * 2, step[i] %= MOD;
  for (i = 1; i < n; ++i) {
    long long a, b;
    cin >> a >> b;
    f[a]++, f[b]++;
  }
  for (i = 1; i <= n; ++i)
    if (f[i] > 1) k1++;
  for (i = 1; i <= n; ++i)
    f[i] > 1 ? res = (res + step[k1]) % MOD : res = (step[k1 + 1] + res) % MOD;
  cout << res << endl;
  return 0;
}
