#include <bits/stdc++.h>
using namespace std;
vector<long long int> v[100005];
long long int dp00[100005], dp01[100005], dp10[100005], dp11[100005],
    up00[100005], up10[100005], up01[100005], up11[100005];
long long int pref0[100005], pref1[100005], suff0[100005], suff1[100005],
    left_child[100005], right_child[100005], leaf[100005];
inline long long int add(long long int x, long long int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
  return x;
}
inline long long int mul(long long int x, long long int y) {
  return (x * y) % 1000000007;
}
void dfs_down(int cur, int par) {
  long long int child = 0;
  for (long long int i = 0; i < v[cur].size(); i++) {
    long long int x = v[cur][i];
    if (x == par) continue;
    child++;
    dfs_down(x, cur);
  }
  if (child == 0) {
    dp00[cur] = 1;
    dp01[cur] = 0;
    dp11[cur] = 1;
    dp10[cur] = 0;
    leaf[cur] = 1;
    return;
  }
  dp00[cur] = 1;
  dp10[cur] = 1;
  dp01[cur] = 1;
  dp11[cur] = 1;
  for (long long int i = 0; i < v[cur].size(); i++) {
    long long int x = v[cur][i];
    if (x == par) continue;
    dp00[cur] = mul(dp00[cur], add(dp10[x], dp00[x]));
    dp11[cur] = mul(dp11[cur], add(dp10[x], dp00[x]));
    dp01[cur] = mul(dp01[cur], add(dp01[x], dp11[x]));
    dp10[cur] = mul(dp10[cur], add(dp11[x], dp01[x]));
  }
  vector<long long int> children;
  for (long long int i = 0; i < v[cur].size(); i++) {
    long long int x = v[cur][i];
    if (x == par) continue;
    children.push_back(x);
  }
  long long int sz = children.size();
  long long int first_child = children[0];
  long long int last_child = children[sz - 1];
  left_child[first_child] = -1;
  for (long long int i = 1; i < sz; i++)
    left_child[children[i]] = children[i - 1];
  right_child[last_child] = -1;
  for (long long int i = sz - 2; i >= 0; i--)
    right_child[children[i]] = children[i + 1];
  pref0[first_child] = add(dp00[first_child], dp10[first_child]);
  pref1[first_child] = add(dp01[first_child], dp11[first_child]);
  for (long long int i = 1; i < sz; i++) {
    pref0[children[i]] = mul(pref0[left_child[children[i]]],
                             add(dp00[children[i]], dp10[children[i]]));
    pref1[children[i]] = mul(pref1[left_child[children[i]]],
                             add(dp01[children[i]], dp11[children[i]]));
  }
  suff0[last_child] = add(dp00[last_child], dp10[last_child]);
  suff1[last_child] = add(dp01[last_child], dp11[last_child]);
  for (long long int i = sz - 2; i >= 0; i--) {
    suff0[children[i]] = mul(suff0[right_child[children[i]]],
                             add(dp00[children[i]], dp10[children[i]]));
    suff1[children[i]] = mul(suff1[right_child[children[i]]],
                             add(dp01[children[i]], dp11[children[i]]));
  }
}
void dfs_up(int cur, int par) {
  long long int temp;
  if (par != -1 && par != 1) {
    temp = up00[par];
    if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
    up00[cur] = add(up00[cur], temp);
    temp = up10[par];
    if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
    up00[cur] = add(up00[cur], temp);
    temp = up01[par];
    if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
    up10[cur] = add(up10[cur], temp);
    temp = up11[par];
    if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
    up10[cur] = add(up10[cur], temp);
    temp = up00[par];
    if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
    up11[cur] = add(up11[cur], temp);
    temp = up10[par];
    if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
    up11[cur] = add(up11[cur], temp);
    temp = up01[par];
    if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
    up01[cur] = add(up01[cur], temp);
    temp = up11[par];
    if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
    if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
    up01[cur] = add(up01[cur], temp);
  } else if (par == -1) {
    up00[cur] = 1;
    up01[cur] = 0;
    up10[cur] = 0;
    up11[cur] = 1;
  } else {
    if (left_child[cur] == -1 && right_child[cur] == -1) {
      up00[cur] = 1;
      up01[cur] = 1;
      up10[cur] = 1;
      up11[cur] = 1;
    } else {
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
      up00[cur] = add(up00[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
      up00[cur] = add(up00[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
      up10[cur] = add(up10[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
      up10[cur] = add(up10[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
      up11[cur] = add(up11[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
      up11[cur] = add(up11[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref1[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff1[right_child[cur]]);
      up01[cur] = add(up01[cur], temp);
      temp = 1;
      if (left_child[cur] != -1) temp = mul(temp, pref0[left_child[cur]]);
      if (right_child[cur] != -1) temp = mul(temp, suff0[right_child[cur]]);
      up01[cur] = add(up01[cur], temp);
    }
  }
  for (long long int i = 0; i < v[cur].size(); i++) {
    long long int x = v[cur][i];
    if (x == par) continue;
    dfs_up(x, cur);
  }
}
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, x, y, ans = 0;
  cin >> n;
  for (i = 1; i <= n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs_down(1, -1);
  dfs_up(1, -1);
  ans = add(dp00[1], dp10[1]);
  for (i = 2; i <= n; i++) {
    if (leaf[i]) {
      ans = add(ans, up10[i]);
      ans = add(ans, up00[i]);
      continue;
    }
    ans = add(ans, mul(dp00[i], up00[i]));
    ans = add(ans, mul(dp10[i], up10[i]));
  }
  cout << ans << "\n";
  return 0;
}
