#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
inline void gn(int &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
inline void gn(long long &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
inline void gn(double &first) { scanf("%lf", &first); }
inline void newline() { putchar('\n'); }
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
vector<int> adj[100011];
int dn[2][2][100011], up[2][2][100011], dwn[2][100011], upp[2][100011];
int M[2][100011];
int re(int u) { return power(u, 1000000007 - 2, 1000000007); }
const int re2 = re(2);
void dfs(int u, int fa = 0) {
  dn[0][0][u] = dn[1][0][u] = dn[0][1][u] = dn[1][1][u] = 1;
  int flag = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    flag = 1;
    dfs(v, u);
    dn[0][0][u] = (long long)dn[0][0][u] * dwn[0][v] % 1000000007;
    dn[0][1][u] = (long long)dn[0][1][u] * dwn[1][v] % 1000000007;
    dn[1][0][u] = (long long)dn[1][0][u] * dwn[1][v] % 1000000007;
    dn[1][1][u] = (long long)dn[1][1][u] * dwn[0][v] % 1000000007;
  }
  if (flag == 0) {
    dn[1][0][u] = 0;
    dn[0][1][u] = 0;
  }
  dwn[0][u] = (dn[0][0][u] + dn[1][0][u]) % 1000000007;
  dwn[1][u] = (dn[0][1][u] + dn[1][1][u]) % 1000000007;
}
void rdfs(int u, int fa = 0) {
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    if (u == 1) {
      up[0][0][v] = up[0][1][v] = up[1][0][v] = up[1][1][v] =
          ((long long)M[0][1] * re(dwn[0][v]) % 1000000007 +
           (long long)M[1][1] * re(dwn[1][v]) % 1000000007) %
          1000000007;
      if (adj[1].size() == 1)
        up[0][1][v] = 1, up[1][0][v] = 1, up[0][0][v] = 1, up[1][1][v] = 1;
    } else {
      up[0][0][v] =
          ((long long)up[0][0][u] * M[0][u] % 1000000007 * re(dwn[0][v]) %
               1000000007 +
           (long long)up[1][0][u] * M[1][u] % 1000000007 * re(dwn[1][v])) %
          1000000007;
      up[0][1][v] =
          ((long long)up[0][1][u] * M[1][u] % 1000000007 * re(dwn[1][v]) %
               1000000007 +
           (long long)up[1][1][u] * M[0][u] % 1000000007 * re(dwn[0][v])) %
          1000000007;
      if (adj[u].size() == 2)
        up[0][0][v] = (up[0][0][u] + up[1][0][u]) % 1000000007,
        up[0][1][v] = (up[0][1][u] + up[1][1][u]) % 1000000007;
      up[1][0][v] = up[0][1][v];
      up[1][1][v] = up[0][0][v];
    }
    rdfs(v, u);
  }
}
void DFS(int u, int fa = 0) {
  int flag = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    DFS(v, u);
    flag = 0;
  }
  if (flag) dn[1][0][u] = dn[0][1][u] = 1;
}
void multidfs(int u, int fa = 0) {
  M[0][u] = 1;
  M[1][u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    M[0][u] = (long long)M[0][u] * dwn[0][v] % 1000000007;
    M[1][u] = (long long)M[1][u] * dwn[1][v] % 1000000007;
    multidfs(v, u);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (n == 1) return puts("1");
  dfs(1);
  multidfs(1);
  rdfs(1);
  DFS(1);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i == 1)
      ans = dwn[0][1];
    else
      ans = (ans + (long long)dn[0][0][i] * up[0][0][i] % 1000000007 +
             (long long)dn[1][0][i] * up[1][0][i] % 1000000007) %
            1000000007;
  }
  cout << ans << endl;
  return 0;
}
