#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
struct edge {
  int to, f;
  edge(int to = 0, int f = 0) : to(to), f(f) {}
};
int N, K;
vector<int> g[100010];
edge e[200010];
long long dp[200010][2], p[200010][2];
long long fpow(long long x, long long p) {
  long long r = 1;
  for (; p; p >>= 1) {
    if (p & 1) r = (r * x) % mod;
    x = (x * x) % mod;
  }
  return r;
}
long long inv(long long x) { return fpow(x, mod - 2); }
void dfs1(int nod, int f) {
  if (g[nod].size() == 1 && nod != 1) {
    p[nod][0] = 1;
    return;
  }
  p[nod][0] = p[nod][1] = 1;
  for (int id : g[nod])
    if (e[id].to != f) {
      dfs1(e[id].to, nod);
      int to = e[id].to;
      dp[id][0] = dp[id][1] = (p[to][0] + p[to][1]) % mod;
      p[nod][0] = p[nod][0] * dp[id][0] % mod;
      p[nod][1] = p[nod][1] * dp[id][1] % mod;
    }
}
void dfs2(int nod, int id) {
  if (nod != 1) {
    for (int x : g[nod])
      if (e[x].to == e[id].f) {
        int f = e[x].to;
        dp[x][0] = (p[f][0] * inv(dp[id][0]) +
                    (g[f].size() == 1 ? 0 : p[f][1] * inv(dp[id][1]))) %
                   mod;
        dp[x][1] = (p[f][0] * inv(dp[id][0]) +
                    (g[f].size() == 1 ? 0 : p[f][1] * inv(dp[id][1]))) %
                   mod;
        p[nod][0] = p[nod][0] * dp[x][0] % mod;
        if (p[nod][1] == 0) p[nod][1] = 1;
        p[nod][1] = p[nod][1] * dp[x][1] % mod;
      }
  }
  for (int nid : g[nod])
    if (e[nid].to != e[id].f) dfs2(e[nid].to, nid);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  if (N == 1) {
    cout << 1 << "\n";
    return 0;
  }
  int i, x, y;
  for (i = 1; i < N; i++) {
    cin >> x >> y;
    e[++K] = edge(y, x);
    e[++K] = edge(x, y);
    g[x].push_back(K - 1);
    g[y].push_back(K);
  }
  long long res = 0;
  dfs1(1, 0);
  for (int id : g[1]) dfs2(e[id].to, id);
  for (int i = 1; i <= N; i++) {
    res = (res + p[i][0] + p[i][1]) % mod;
  }
  cout << res << "\n";
  return 0;
}
