#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
long long go(long long a, long long b, long long m) {
  if (b == 0)
    return 1;
  else if (b == 1)
    return a % m;
  long long ret = go(a, b / 2, m);
  ret = (ret * ret) % m;
  if (b & 1) ret = (ret * a) % m;
  return ret;
}
long long f(long long a, long long b, long long m) {
  long long r = go(b, m - 2, m);
  r = (r * a) % m;
  return r;
}
vector<long long> v[200000];
struct data {
  long long x, y;
};
data b[200000];
long long ch[200000], g[200000], cnt = 0;
void dfs(long long i, long long p) {
  long long j, st = v[i].size(), x, cc = 0;
  if (ch[i] == 1) return;
  ch[i] = 1;
  for (j = 0; j < st; j++) {
    if (v[i][j] == p) continue;
    dfs(v[i][j], i);
    cc = 1;
  }
  x = 1;
  if (cc == 0) {
    b[i].x = 1;
    b[i].y = 1;
  } else {
    for (j = 0; j < st; j++) {
      if (v[i][j] == p) continue;
      x *= b[v[i][j]].x;
      x %= 1000000007;
    }
    b[i].x = x * 2;
    b[i].y = x * 2;
    b[i].x %= 1000000007;
    b[i].y %= 1000000007;
  }
  return;
}
void ddfs(long long i, long long p) {
  long long j, st = v[i].size(), c;
  if (p != 0) {
    if (g[p] == 1)
      c = 1;
    else
      c = f(b[p].x, b[i].x, 1000000007);
    if (g[i] == 1)
      b[i].x *= c * 2;
    else
      b[i].x *= c;
    b[i].x %= 1000000007;
    cnt += b[i].x;
    cnt %= 1000000007;
  } else {
    cnt += b[i].x;
    cnt %= 1000000007;
  }
  for (j = 0; j < st; j++) {
    if (v[i][j] == p) continue;
    ddfs(v[i][j], i);
  }
}
int main() {
  long long n, i, x, y;
  scanf("%lld", &n);
  for (i = 1; i < n; i++) {
    scanf("%lld %lld", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
    g[x]++;
    g[y]++;
  }
  dfs(1, 0);
  ddfs(1, 0);
  printf("%lld", cnt);
  return 0;
}
