#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const double PI = 3.14159265358979323846;
const int maxn = (int)100001;
const long long mod = (long long)1e9 + 7;
const long long inf = (long long)1e9 + 7;
const double eps = 1e-6;
int n, x, y;
long long dp[maxn][2], sz[maxn], st[maxn], ans;
vector<vector<int> > v(maxn);
long long bpow(long long x, long long y) {
  if (y == 1) {
    return x;
  } else if (y == 0) {
    return 1;
  } else if (y % 2 == 1) {
    return (x * bpow(x, y - 1)) % mod;
  } else {
    long long tmp = bpow(x, y / 2);
    return (tmp * tmp) % mod;
  }
}
void dfs(int ver, int p) {
  if (v[ver].size() == 1 && p != -1) {
    dp[ver][0] = 1;
    dp[ver][1] = 1;
    sz[ver] = 1;
    return;
  }
  long long p1 = 1;
  long long p2 = 1;
  sz[ver] = 1;
  for (int i = 0; i < v[ver].size(); i++) {
    int to = v[ver][i];
    if (p == to) {
      continue;
    }
    dfs(to, ver);
    p1 *= dp[to][0];
    p1 %= mod;
    p2 *= dp[to][1];
    p2 %= mod;
    sz[ver] += sz[to];
  }
  dp[ver][0] = p1 + p2;
  dp[ver][0] %= mod;
  dp[ver][1] = p1 + p2;
  dp[ver][1] %= mod;
  return;
}
void dfs1(int ver, long long good, long long bad, int p) {
  long long p1 = good;
  long long p2 = bad;
  for (int i = 0; i < v[ver].size(); i++) {
    int to = v[ver][i];
    if (p == to) {
      continue;
    }
    p1 *= dp[to][0];
    p1 %= mod;
    p2 *= dp[to][1];
    p2 %= mod;
  }
  ans += p1 + p2;
  ans %= mod;
  for (int i = 0; i < v[ver].size(); i++) {
    int to = v[ver][i];
    if (to == p) {
      continue;
    }
    long long tp1 = p1;
    long long tp2 = p2;
    tp1 *= bpow(dp[to][0], mod - 2);
    tp1 %= mod;
    tp2 *= bpow(dp[to][1], mod - 2);
    tp2 %= mod;
    long long tmp = (tp1 + tp2) % mod;
    if (p == -1 && v[ver].size() == 1) {
      dfs1(to, tp1, tp2, ver);
    } else {
      dfs1(to, tmp, tmp, ver);
    }
  }
}
int main() {
  st[0] = 1;
  for (int i = 1; i < maxn; i++) {
    st[i] = st[i - 1] * 2;
    st[i] %= mod;
  }
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, -1);
  dfs1(1, 1, 1, -1);
  cout << ans;
  return 0;
}
