#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 100010;
int nowarn;
int n, ans = 0;
namespace Tree {
int head[MAXN], nxt[MAXN << 1], to[MAXN << 1], m;
void init() {
  m = 0;
  memset(head, -1, sizeof(head));
}
void adde(int u, int v) {
  to[m] = v, nxt[m] = head[u], head[u] = m++;
  to[m] = u, nxt[m] = head[v], head[v] = m++;
}
}  // namespace Tree
int fpow(int a, int b) {
  int c = 1;
  while (b) {
    if (b & 1) c = int((long long)c * a % MOD);
    a = int((long long)a * a % MOD);
    b >>= 1;
  }
  return c;
}
int inv(int a) { return fpow(a, MOD - 2); }
int f[MAXN];
void dfs1(int u, int fa) {
  using namespace Tree;
  f[u] = 1;
  for (int i = head[u]; ~i; i = nxt[i]) {
    int v = to[i];
    if (v == fa) continue;
    dfs1(v, u);
    f[u] = int((long long)f[u] * f[v] % MOD);
  }
  if (nxt[head[u]] != -1 || !fa) f[u] = f[u] * 2 % MOD;
}
void dfs2(int u, int fa, int ffa) {
  using namespace Tree;
  int g = int((long long)f[u] * inv(2) % MOD * ffa % MOD);
  if (nxt[head[u]] != -1 || !fa) {
    ans = (ans + g * 2 % MOD) % MOD;
  } else {
    ans = (ans + g * 2 % MOD * 2 % MOD) % MOD;
  }
  for (int i = head[u]; ~i; i = nxt[i]) {
    int v = to[i];
    if (v == fa) continue;
    int g2 = int((long long)g * inv(f[v]) % MOD * 2 % MOD);
    if (!fa && nxt[head[u]] == -1) g2 = int((long long)g2 * inv(2) % MOD);
    dfs2(v, u, g2);
  }
}
int main() {
  nowarn = scanf("%d", &n);
  Tree::init();
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    nowarn = scanf("%d%d", &u, &v);
    Tree::adde(u, v);
  }
  dfs1(1, 0), dfs2(1, 0, 1);
  printf("%d\n", ans);
  return 0;
}
