#include <bits/stdc++.h>
using namespace std;
const int N = 100003;
const int _2 = 500000004;
struct E {
  int v, next;
} e[N * 2];
int n, head[N], k = 1;
bool Leaf(int u) { return e[head[u]].next == 0; }
long long f[N], ans;
void ADD(int u, int v) {
  e[k] = (E){v, head[u]};
  head[u] = k++;
}
void Dfs(int u, int fa) {
  f[u] = 1;
  if (Leaf(u) && u != 1) return;
  for (int i = head[u], v = e[i].v; i; i = e[i].next, v = e[i].v)
    if (v != fa) {
      Dfs(v, u);
      (f[u] *= f[v]) %= 1000000007;
    }
  (f[u] <<= 1) %= 1000000007;
}
void dfs(int u, int fa, long long val) {
  long long now = val * (Leaf(fa) ? _2 : 1) * (Leaf(u) ? 2 : 1);
  (ans += now) %= 1000000007;
  for (int i = head[u], v = e[i].v; i; i = e[i].next, v = e[i].v)
    if (v != fa) dfs(v, u, now);
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    ADD(u, v);
    ADD(v, u);
  }
  Dfs(1, 1);
  ans = f[1];
  for (int i = head[1], v = e[i].v; i; i = e[i].next, v = e[i].v)
    if (v != 1) dfs(v, 1, f[1]);
  printf("%d\n", (ans % 1000000007 + 1000000007) % 1000000007);
  return 0;
}
