#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
const int mod = 1e9 + 7;
int head[N], cnt, n, d[N], f[N][21], dep[N], q[N];
long long b[N];
struct nd {
  int ne, to;
} e[N * 2];
void in(int x, int y) {
  e[++cnt].to = y;
  e[cnt].ne = head[x];
  head[x] = cnt;
}
int main() {
  scanf("%d", &n);
  b[0] = 1;
  for (int i = 1; i < N; ++i) b[i] = (b[i - 1] * 2) % mod;
  for (int i = 1, x, y; i < n; ++i)
    scanf("%d%d", &x, &y), in(x, y), in(y, x), d[x]++, d[y]++;
  for (int i = 1; i <= n; ++i)
    if (d[i] == 1) q[++q[0]] = i;
  long long ans = 0;
  for (int i = 1; i <= n; ++i) (ans += b[n - q[0] + (d[i] == 1)]) %= mod;
  cout << ans;
}
